mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
short string in matrix should be in fixed set
This commit is contained in:
@@ -935,7 +935,6 @@ new_string(unsigned int h, const char *str, lu_byte l) {
|
|||||||
memset(ts, 0, sz);
|
memset(ts, 0, sz);
|
||||||
setbits(ts->marked, WHITEBITS);
|
setbits(ts->marked, WHITEBITS);
|
||||||
gray2black(ts);
|
gray2black(ts);
|
||||||
makeshared(ts);
|
|
||||||
ts->tt = LUA_TSHRSTR;
|
ts->tt = LUA_TSHRSTR;
|
||||||
ts->hash = h;
|
ts->hash = h;
|
||||||
ts->shrlen = l;
|
ts->shrlen = l;
|
||||||
|
|||||||
@@ -47,7 +47,10 @@ mark_shared(lua_State *L) {
|
|||||||
case LUA_TSTRING: {
|
case LUA_TSTRING: {
|
||||||
const char *str = lua_tostring(L, idx);
|
const char *str = lua_tostring(L, idx);
|
||||||
TString *ts = (TString *)(str - sizeof(UTString));
|
TString *ts = (TString *)(str - sizeof(UTString));
|
||||||
|
if(ts->tt == LUA_TLNGSTR)
|
||||||
makeshared(ts);
|
makeshared(ts);
|
||||||
|
else
|
||||||
|
luaS_fix(G(L), ts);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user