MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / atomic

Function atomic

Source/Misc/lua/src/lua.c:6527–6555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6525
6526
6527static void atomic (lua_State *L) {
6528global_State *g = G(L);
6529size_t udsize; /* total size of userdata to be finalized */
6530/* remark occasional upvalues of (maybe) dead threads */
6531remarkupvals(g);
6532/* traverse objects cautch by write barrier and by 'remarkupvals' */
6533propagateall(g);
6534/* remark weak tables */
6535g->gray = g->weak;
6536g->weak = NULL;
6537lua_assert(!iswhite(obj2gco(g->mainthread)));
6538markobject(g, L); /* mark running thread */
6539markmt(g); /* mark basic metatables (again) */
6540propagateall(g);
6541/* remark gray again */
6542g->gray = g->grayagain;
6543g->grayagain = NULL;
6544propagateall(g);
6545udsize = luaC_separateudata(L, 0); /* separate userdata to be finalized */
6546marktmu(g); /* mark `preserved' userdata */
6547udsize += propagateall(g); /* remark, to propagate `preserveness' */
6548cleartable(g->weak); /* remove collected objects from weak tables */
6549/* flip current white */
6550g->currentwhite = cast_byte(otherwhite(g));
6551g->sweepstrgc = 0;
6552g->sweepgc = &g->rootgc;
6553g->gcstate = GCSsweepstring;
6554g->estimate = g->totalbytes - udsize; /* first estimate */
6555}
6556
6557
6558static l_mem singlestep (lua_State *L) {

Callers 1

singlestepFunction · 0.85

Calls 6

remarkupvalsFunction · 0.85
propagateallFunction · 0.85
markmtFunction · 0.85
luaC_separateudataFunction · 0.85
marktmuFunction · 0.85
cleartableFunction · 0.85

Tested by

no test coverage detected