mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
bugfix: make proto shared
This commit is contained in:
@@ -301,7 +301,7 @@ const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
|
|||||||
|
|
||||||
void luaF_shareproto (Proto *f) {
|
void luaF_shareproto (Proto *f) {
|
||||||
int i;
|
int i;
|
||||||
if (f == NULL)
|
if (f == NULL || isshared(f))
|
||||||
return;
|
return;
|
||||||
makeshared(f);
|
makeshared(f);
|
||||||
luaS_share(f->source);
|
luaS_share(f->source);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ int luaS_eqshrstr (TString *a, TString *b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void luaS_share (TString *ts) {
|
void luaS_share (TString *ts) {
|
||||||
if (ts == NULL)
|
if (ts == NULL || isshared(ts))
|
||||||
return;
|
return;
|
||||||
makeshared(ts);
|
makeshared(ts);
|
||||||
ts->id = ATOM_DEC(&STRID);
|
ts->id = ATOM_DEC(&STRID);
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ mark_shared(lua_State *L) {
|
|||||||
} else if (!lua_iscfunction(L, idx)) {
|
} else if (!lua_iscfunction(L, idx)) {
|
||||||
LClosure *f = (LClosure *)lua_topointer(L, idx);
|
LClosure *f = (LClosure *)lua_topointer(L, idx);
|
||||||
makeshared(f);
|
makeshared(f);
|
||||||
|
lua_sharefunction(L, idx);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LUA_TSTRING:
|
case LUA_TSTRING:
|
||||||
|
|||||||
Reference in New Issue
Block a user