add debug api to show current service c memory

This commit is contained in:
Cloud Wu
2015-12-17 22:13:51 +08:00
parent 9d6bde01a3
commit 20610723a1
4 changed files with 31 additions and 0 deletions

View File

@@ -41,6 +41,12 @@ lexpandshrtbl(lua_State *L) {
return 0;
}
static int
lcurrent(lua_State *L) {
lua_pushinteger(L, malloc_current_memory());
return 1;
}
int
luaopen_memory(lua_State *L) {
luaL_checkversion(L);
@@ -53,6 +59,7 @@ luaopen_memory(lua_State *L) {
{ "info", dump_mem_lua },
{ "ssinfo", luaS_shrinfo },
{ "ssexpand", lexpandshrtbl },
{ "current", lcurrent },
{ NULL, NULL },
};