mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
use skynet_malloc in skynet_realloc
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user