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

Function sweep2old

extlibs/lua/src/lgc.c:976–989  ·  view source on GitHub ↗

** Sweep a list of objects, deleting dead ones and turning ** the non dead to old (without changing their colors). */

Source from the content-addressed store, hash-verified

974** the non dead to old (without changing their colors).
975*/
976static void sweep2old (lua_State *L, GCObject **p) {
977 GCObject *curr;
978 while ((curr = *p) != NULL) {
979 if (iswhite(curr)) { /* is 'curr' dead? */
980 lua_assert(isdead(G(L), curr));
981 *p = curr->next; /* remove 'curr' from list */
982 freeobj(L, curr); /* erase 'curr' */
983 }
984 else { /* all surviving objects become old */
985 setage(curr, G_OLD);
986 p = &curr->next; /* go to next element */
987 }
988 }
989}
990
991
992/*

Callers 1

atomic2genFunction · 0.85

Calls 1

freeobjFunction · 0.85

Tested by

no test coverage detected