bugifx: clean prefix

This commit is contained in:
Cloud
2014-04-18 18:35:37 +08:00
parent b6b639b204
commit 23cfb11954
2 changed files with 2 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ jemalloc : $(JEMALLOC_STATICLIB)
# skynet # skynet
CSERVICE = snlua logger gate master harbor CSERVICE = snlua logger gate master harbor
LUA_CLIB = skynet socketdriver int64 bson mongo md5 netpack cjson clientsocket memory LUA_CLIB = skynet socketdriver int64 bson mongo md5 netpack cjson clientsocket # memory
SKYNET_SRC = skynet_main.c skynet_handle.c skynet_module.c skynet_mq.c \ SKYNET_SRC = skynet_main.c skynet_handle.c skynet_module.c skynet_mq.c \
skynet_server.c skynet_start.c skynet_timer.c skynet_error.c \ skynet_server.c skynet_start.c skynet_timer.c skynet_error.c \

View File

@@ -73,8 +73,7 @@ fill_prefix(char* ptr) {
inline static void* inline static void*
clean_prefix(char* ptr) { clean_prefix(char* ptr) {
uint32_t* rawptr = (uint32_t*)ptr - 1; size_t size = je_malloc_usable_size(ptr);
size_t size = je_malloc_usable_size(rawptr);
uint32_t *p = (uint32_t *)(ptr + size - sizeof(uint32_t)); uint32_t *p = (uint32_t *)(ptr + size - sizeof(uint32_t));
uint32_t handle; uint32_t handle;
memcpy(&handle, p, sizeof(handle)); memcpy(&handle, p, sizeof(handle));