Merge pull request #328 from cloudwu/shrtbl

global shared string table
This commit is contained in:
云风
2015-08-27 21:16:47 +08:00
11 changed files with 291 additions and 9 deletions

View File

@@ -2,6 +2,7 @@
#include <lauxlib.h>
#include "malloc_hook.h"
#include "luashrtbl.h"
static int
ltotal(lua_State *L) {
@@ -33,6 +34,13 @@ ldump(lua_State *L) {
return 0;
}
static int
lexpandshrtbl(lua_State *L) {
int n = luaL_checkinteger(L, 1);
luaS_expandshr(n);
return 0;
}
int
luaopen_memory(lua_State *L) {
luaL_checkversion(L);
@@ -43,6 +51,8 @@ luaopen_memory(lua_State *L) {
{ "dumpinfo", ldumpinfo },
{ "dump", ldump },
{ "info", dump_mem_lua },
{ "ssinfo", luaS_shrinfo },
{ "ssexpand", lexpandshrtbl },
{ NULL, NULL },
};