** barrier that moves collector forward, that is, mark the white object ** being pointed by a black object. */
| 133 | ** being pointed by a black object. |
| 134 | */ |
| 135 | void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { |
| 136 | global_State *g = G(L); |
| 137 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); |
| 138 | lua_assert(g->gcstate != GCSpause); |
| 139 | lua_assert(gch(o)->tt != LUA_TTABLE); |
| 140 | if (keepinvariantout(g)) /* must keep invariant? */ |
| 141 | reallymarkobject(g, v); /* restore invariant */ |
| 142 | else { /* sweep phase */ |
| 143 | lua_assert(issweepphase(g)); |
| 144 | makewhite(g, o); /* mark main obj. as white to avoid other barriers */ |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | |
| 149 | /* |
nothing calls this directly
no test coverage detected