From a99befd44c309495eab9ed6b8c3fc1f7bf9b9e0c Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 22 Apr 2014 15:27:45 +0800 Subject: [PATCH] use skynet_malloc in skynet_realloc --- skynet-src/malloc_hook.c | 2 +- skynet-src/skynet_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/skynet-src/malloc_hook.c b/skynet-src/malloc_hook.c index 36048988..19f6e3ad 100644 --- a/skynet-src/malloc_hook.c +++ b/skynet-src/malloc_hook.c @@ -158,7 +158,7 @@ skynet_malloc(size_t size) { void * skynet_realloc(void *ptr, size_t size) { - if (ptr == NULL) return malloc(size); + if (ptr == NULL) return skynet_malloc(size); void* rawptr = clean_prefix(ptr); void *newptr = je_realloc(rawptr, size+PREFIX_SIZE); diff --git a/skynet-src/skynet_main.c b/skynet-src/skynet_main.c index ec60e2a1..8cebd00e 100644 --- a/skynet-src/skynet_main.c +++ b/skynet-src/skynet_main.c @@ -93,7 +93,7 @@ main(int argc, char *argv[]) { struct skynet_config config; - struct lua_State *L = luaL_newstate(); + struct lua_State *L = lua_newstate(skynet_lalloc, NULL); luaL_openlibs(L); // link lua lib lua_close(L);