All objects are kept 'new' in incremental GC

Small changes to ensure that all objects are kept 'new' in incremental
GC (except for fixed strings, which are always old) and to make that
fact clearer.
This commit is contained in:
Roberto Ierusalimschy
2020-07-27 11:39:42 -03:00
parent 8c7c9ea065
commit d2c2e32e8a
2 changed files with 24 additions and 19 deletions

View File

@@ -234,9 +234,10 @@ int luaF_close (lua_State *L, StkId level, int status) {
luaF_unlinkupval(uv);
setobj(L, slot, uv->v); /* move value to upvalue slot */
uv->v = slot; /* now current value lives here */
if (!iswhite(uv))
if (!iswhite(uv)) { /* neither white nor dead? */
gray2black(uv); /* closed upvalues cannot be gray */
luaC_barrier(L, uv, slot);
luaC_barrier(L, uv, slot);
}
}
return status;
}