memory warning

This commit is contained in:
Cloud Wu
2016-05-06 20:37:51 +08:00
parent a6299a0748
commit 76d1e6fa1f
4 changed files with 26 additions and 4 deletions

View File

@@ -227,7 +227,7 @@ skynet_strdup(const char *str) {
}
void *
skynet_lalloc(void *ud, void *ptr, size_t osize, size_t nsize) {
skynet_lalloc(void *ptr, size_t osize, size_t nsize) {
if (nsize == 0) {
raw_free(ptr);
return NULL;

View File

@@ -115,7 +115,7 @@ main(int argc, char *argv[]) {
struct skynet_config config;
struct lua_State *L = lua_newstate(skynet_lalloc, NULL);
struct lua_State *L = luaL_newstate();
luaL_openlibs(L); // link lua lib
int err = luaL_loadstring(L, load_config);

View File

@@ -13,6 +13,6 @@ void * skynet_calloc(size_t nmemb,size_t size);
void * skynet_realloc(void *ptr, size_t size);
void skynet_free(void *ptr);
char * skynet_strdup(const char *str);
void * skynet_lalloc(void *ud, void *ptr, size_t osize, size_t nsize); // use for lua
void * skynet_lalloc(void *ptr, size_t osize, size_t nsize); // use for lua
#endif