Add new sharetable

This commit is contained in:
Cloud Wu
2019-04-17 21:30:47 +08:00
committed by 云风
parent 2ceb642b5d
commit 76b166f04a
8 changed files with 392 additions and 3 deletions

View File

@@ -1018,6 +1018,7 @@ static l_mem atomic (lua_State *L) {
clearvalues(g, g->allweak, origall);
luaS_clearcache(g);
g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */
luaS_collect(g, 0); /* send short strings set to gc thread */
work += g->GCmemtrav; /* complete counting */
return work; /* estimate of memory marked by 'atomic' */
}
@@ -1084,7 +1085,6 @@ static lu_mem singlestep (lua_State *L) {
return (n * GCFINALIZECOST);
}
else { /* emergency mode or no more finalizers */
luaS_collect(g, 0); /* send short strings set to gc thread */
g->gcstate = GCSpause; /* finish collection */
return 0;
}