diff --git a/Makefile b/Makefile index fb63c1ae..958c1fb8 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ jemalloc : $(JEMALLOC_STATICLIB) # skynet 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_server.c skynet_start.c skynet_timer.c skynet_error.c \ diff --git a/skynet-src/malloc_hook.c b/skynet-src/malloc_hook.c index c0d91355..bba82ac4 100644 --- a/skynet-src/malloc_hook.c +++ b/skynet-src/malloc_hook.c @@ -73,8 +73,7 @@ fill_prefix(char* ptr) { inline static void* clean_prefix(char* ptr) { - uint32_t* rawptr = (uint32_t*)ptr - 1; - size_t size = je_malloc_usable_size(rawptr); + size_t size = je_malloc_usable_size(ptr); uint32_t *p = (uint32_t *)(ptr + size - sizeof(uint32_t)); uint32_t handle; memcpy(&handle, p, sizeof(handle));