diff --git a/Makefile b/Makefile index 2982e62c..b92a1a33 100644 --- a/Makefile +++ b/Makefile @@ -130,7 +130,9 @@ clean : rm -f $(SKYNET_BUILD_PATH)/skynet $(CSERVICE_PATH)/*.so $(LUA_CLIB_PATH)/*.so cleanall: clean +ifneq (,$(wildcard 3rd/jemalloc/Makefile)) cd 3rd/jemalloc && $(MAKE) clean +endif cd 3rd/lua && $(MAKE) clean rm -f $(LUA_STATICLIB) diff --git a/service-src/service_snlua.c b/service-src/service_snlua.c index b839b117..89e607f6 100644 --- a/service-src/service_snlua.c +++ b/service-src/service_snlua.c @@ -12,7 +12,6 @@ struct snlua { lua_State * L; struct skynet_context * ctx; - FILE *f; }; // LUA_CACHELIB may defined in patched lua for shared proto @@ -144,35 +143,17 @@ snlua_init(struct snlua *l, struct skynet_context *ctx, const char * args) { return 0; } -static void * -lalloc(void *ud, void *ptr, size_t osize, size_t nsize) { - struct snlua * l = ud; - if (l->f) { - fprintf(l->f, "%p %d %d\n", ptr, (int)osize, (int)nsize); - } - if (nsize == 0) { - skynet_free(ptr); - return NULL; - } else { - return skynet_realloc(ptr, nsize); - } -} - struct snlua * snlua_create(void) { struct snlua * l = skynet_malloc(sizeof(*l)); memset(l,0,sizeof(*l)); - char tmp[L_tmpnam]; - l->f = fopen(tmpnam(tmp),"wb"); -// printf("%s\n", tmp); - l->L = lua_newstate(lalloc, l); + l->L = lua_newstate(skynet_lalloc, NULL); return l; } void snlua_release(struct snlua *l) { lua_close(l->L); - fclose(l->f); skynet_free(l); } diff --git a/skynet-src/malloc_hook.c b/skynet-src/malloc_hook.c index 3cff09fa..d9ad6f32 100644 --- a/skynet-src/malloc_hook.c +++ b/skynet-src/malloc_hook.c @@ -218,7 +218,6 @@ skynet_strdup(const char *str) { void * skynet_lalloc(void *ud, void *ptr, size_t osize, size_t nsize) { - printf("%p osize = %d nsize = %d\n", ptr, (int)osize, (int)nsize); if (nsize == 0) { skynet_free(ptr); return NULL;