** barrier that moves collector forward, that is, mark the white object ** 'v' being pointed by the black object 'o'. (If in sweep phase, clear ** the black object to white [sweep it] to avoid other barrier calls for ** this same object.) In the generational mode, 'v' must also become ** old, if 'o' is old; however, it cannot be changed directly to OLD, ** because it may still point to non-old obj
| 191 | ** will finally become OLD (regular old). |
| 192 | */ |
| 193 | void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { |
| 194 | global_State *g = G(L); |
| 195 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); |
| 196 | if (keepinvariant(g)) { /* must keep invariant? */ |
| 197 | reallymarkobject(g, v); /* restore invariant */ |
| 198 | if (isold(o)) { |
| 199 | lua_assert(!isold(v)); /* white object could not be old */ |
| 200 | setage(v, G_OLD0); /* restore generational invariant */ |
| 201 | } |
| 202 | } |
| 203 | else { /* sweep phase */ |
| 204 | lua_assert(issweepphase(g)); |
| 205 | makewhite(g, o); /* mark main obj. as white to avoid other barriers */ |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | |
| 210 | /* |
nothing calls this directly
no test coverage detected