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

16
skynet-src/luashrtbl.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef LUA_SHORT_STRING_TABLE_H
#define LUA_SHORT_STRING_TABLE_H
#include "lstring.h"
// If you use modified lua, this macro would be defined in lstring.h
#ifndef ENABLE_SHORT_STRING_TABLE
static inline int luaS_shrinfo(lua_State *L) { return 0; }
static inline void luaS_initshr() {}
static inline void luaS_exitshr() {}
static inline void luaS_expandshr(int n);
#endif
#endif

View File

@@ -3,6 +3,7 @@
#include "skynet_imp.h"
#include "skynet_env.h"
#include "skynet_server.h"
#include "luashrtbl.h"
#include <stdio.h>
#include <stdlib.h>
@@ -105,6 +106,8 @@ main(int argc, char *argv[]) {
"usage: skynet configfilename\n");
return 1;
}
luaS_initshr();
skynet_globalinit();
skynet_env_init();
@@ -139,6 +142,7 @@ main(int argc, char *argv[]) {
skynet_start(&config);
skynet_globalexit();
luaS_exitshr();
return 0;
}