Skip to content

Commit

Permalink
use skynet_malloc in skynet_realloc
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Apr 22, 2014
1 parent 61c8c76 commit a99befd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion skynet-src/malloc_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion skynet-src/skynet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a99befd

Please sign in to comment.