mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
Add new sharetable
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -509,7 +509,7 @@ exist(struct ssm_ref *r, TString *s) {
|
||||
TString *t = r->array[mid];
|
||||
if (t == s)
|
||||
return 1;
|
||||
if (s > t)
|
||||
if (memcmp(&s,&t,sizeof(TString *)) > 0)
|
||||
begin = mid + 1;
|
||||
else
|
||||
end = mid - 1;
|
||||
|
||||
@@ -207,6 +207,8 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
|
||||
const TValue *tm; /* '__newindex' metamethod */
|
||||
if (slot != NULL) { /* is 't' a table? */
|
||||
Table *h = hvalue(t); /* save 't' table */
|
||||
if (isshared(h))
|
||||
luaG_typeerror(L, t, "change");
|
||||
lua_assert(ttisnil(slot)); /* old value must be nil */
|
||||
tm = fasttm(L, h->metatable, TM_NEWINDEX); /* get metamethod */
|
||||
if (tm == NULL) { /* no metamethod? */
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
(!ttistable(t) \
|
||||
? (slot = NULL, 0) \
|
||||
: (slot = f(hvalue(t), k), \
|
||||
ttisnil(slot) ? 0 \
|
||||
(ttisnil(slot) || isshared(hvalue(t))) ? 0 \
|
||||
: (luaC_barrierback(L, hvalue(t), v), \
|
||||
setobj2t(L, cast(TValue *,slot), v), \
|
||||
1)))
|
||||
|
||||
Reference in New Issue
Block a user