mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
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:
parent
8c7c9ea065
commit
d2c2e32e8a
2 changed files with 24 additions and 19 deletions
5
lfunc.c
5
lfunc.c
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue