You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line describes the GC invariant as being the white objects can never point to black ones. Reading that made the GC code and other comments bewildering, until I realized that the referenced comment is probably just backwards. Isn't the invariant instead that black objects can never point to white ones? Before an object can be promoted from gray to black, all the collectable objects it points to must themselves be darkened (from white to gray, or left as gray or black if they've already been so marked).
The text was updated successfully, but these errors were encountered:
Yeah this comment is backwards, this is from original Lua 5.1 source. Recent Lua source contains a correct comment (https://github.com/lua/lua/blob/master/lgc.h#L17-L28) that also applies to Luau implementation except that "moreover" statement would need to be tweaked.
The comment gave an incorrect (reversed) version of the invariant, which
could be confusing for people who haven't read the full description in
lgc.cpp.
Unfortunately this change is difficult to flag.
Fixes#1282.
This line describes the GC invariant as being the white objects can never point to black ones. Reading that made the GC code and other comments bewildering, until I realized that the referenced comment is probably just backwards. Isn't the invariant instead that black objects can never point to white ones? Before an object can be promoted from gray to black, all the collectable objects it points to must themselves be darkened (from white to gray, or left as gray or black if they've already been so marked).
The text was updated successfully, but these errors were encountered: