** barrier that moves collector forward, that is, mark the white object ** being pointed by a black object. (If in sweep phase, clear the black ** object to white [sweep it] to avoid other barrier calls for this ** same object.) */
| 153 | ** same object.) |
| 154 | */ |
| 155 | void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { |
| 156 | global_State *g = G(L); |
| 157 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); |
| 158 | if (keepinvariant(g)) /* must keep invariant? */ |
| 159 | reallymarkobject(g, v); /* restore invariant */ |
| 160 | else { /* sweep phase */ |
| 161 | lua_assert(issweepphase(g)); |
| 162 | makewhite(g, o); /* mark main obj. as white to avoid other barriers */ |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | |
| 167 | /* |
nothing calls this directly
no test coverage detected