MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaC_barrier_

Function luaC_barrier_

depends/lua/src/lgc.c:155–164  ·  view source on GitHub ↗

** 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.) */

Source from the content-addressed store, hash-verified

153** same object.)
154*/
155void 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/*

Callers

nothing calls this directly

Calls 1

reallymarkobjectFunction · 0.85

Tested by

no test coverage detected