MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaC_barrier_

Function luaC_barrier_

extlibs/lua/src/lgc.c:193–207  ·  view source on GitHub ↗

** 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

Source from the content-addressed store, hash-verified

191** will finally become OLD (regular old).
192*/
193void 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/*

Callers

nothing calls this directly

Calls 1

reallymarkobjectFunction · 0.85

Tested by

no test coverage detected