MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaC_barrier_

Function luaC_barrier_

third-party/lua-5.2.4/src/lgc.c:135–146  ·  view source on GitHub ↗

** barrier that moves collector forward, that is, mark the white object ** being pointed by a black object. */

Source from the content-addressed store, hash-verified

133** being pointed by a black object.
134*/
135void 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/*

Callers

nothing calls this directly

Calls 1

reallymarkobjectFunction · 0.70

Tested by

no test coverage detected