MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / atomic

Function atomic

other_src/lua/src/lgc.cpp:526–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524
525
526static void atomic (lua_State *L) {
527 global_State *g = G(L);
528 size_t udsize; /* total size of userdata to be finalized */
529 /* remark occasional upvalues of (maybe) dead threads */
530 remarkupvals(g);
531 /* traverse objects cautch by write barrier and by 'remarkupvals' */
532 propagateall(g);
533 /* remark weak tables */
534 g->gray = g->weak;
535 g->weak = NULL;
536 lua_assert(!iswhite(obj2gco(g->mainthread)));
537 markobject(g, L); /* mark running thread */
538 markmt(g); /* mark basic metatables (again) */
539 propagateall(g);
540 /* remark gray again */
541 g->gray = g->grayagain;
542 g->grayagain = NULL;
543 propagateall(g);
544 udsize = luaC_separateudata(L, 0); /* separate userdata to be finalized */
545 marktmu(g); /* mark `preserved' userdata */
546 udsize += propagateall(g); /* remark, to propagate `preserveness' */
547 cleartable(g->weak); /* remove collected objects from weak tables */
548 /* flip current white */
549 g->currentwhite = cast_byte(otherwhite(g));
550 g->sweepstrgc = 0;
551 g->sweepgc = &g->rootgc;
552 g->gcstate = GCSsweepstring;
553 g->estimate = g->totalbytes - udsize; /* first estimate */
554}
555
556
557static l_mem singlestep (lua_State *L) {

Callers 1

singlestepFunction · 0.70

Calls 6

remarkupvalsFunction · 0.70
propagateallFunction · 0.70
markmtFunction · 0.70
luaC_separateudataFunction · 0.70
marktmuFunction · 0.70
cleartableFunction · 0.70

Tested by

no test coverage detected