rewrite SSM and clonefunction

This commit is contained in:
Cloud Wu
2019-04-16 21:16:13 +08:00
committed by 云风
parent 2d6d2c75a4
commit 2ceb642b5d
32 changed files with 934 additions and 645 deletions

View File

@@ -6,10 +6,23 @@
// 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) {}
struct ssm_info {
int total;
int longest;
int slots;
size_t size;
double variance;
};
struct ssm_collect {
void *key;
int n;
};
static inline void luaS_initssm();
static inline void luaS_exitssm();
static inline void luaS_infossm(struct ssm_info *info) {}
static inline int luaS_collectssm(struct ssm_collect *info) { return 0; }
#endif

View File

@@ -126,7 +126,7 @@ main(int argc, char *argv[]) {
return 1;
}
luaS_initshr();
luaS_initssm();
skynet_globalinit();
skynet_env_init();
@@ -162,7 +162,7 @@ main(int argc, char *argv[]) {
skynet_start(&config);
skynet_globalexit();
luaS_exitshr();
luaS_exitssm();
return 0;
}