MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / checkobject

Function checkobject

Dependencies/lua/src/ltests.c:513–532  ·  view source on GitHub ↗

** Check consistency of an object: ** - Dead objects can only happen in the 'allgc' list during a sweep ** phase (controlled by the caller through 'maybedead'). ** - During pause, all objects must be white. ** - In generational mode: ** * objects must be old enough for their lists ('listage'). ** * old objects cannot be white. ** * old objects must be black, except for 'touched1', 'old0', **

Source from the content-addressed store, hash-verified

511** threads, and open upvalues.
512*/
513static void checkobject (global_State *g, GCObject *o, int maybedead,
514 int listage) {
515 if (isdead(g, o))
516 assert(maybedead);
517 else {
518 assert(g->gcstate != GCSpause || iswhite(o));
519 if (g->gckind == KGC_GEN) { /* generational mode? */
520 assert(getage(o) >= listage);
521 assert(!iswhite(o) || !isold(o));
522 if (isold(o)) {
523 assert(isblack(o) ||
524 getage(o) == G_TOUCHED1 ||
525 getage(o) == G_OLD0 ||
526 o->tt == LUA_VTHREAD ||
527 (o->tt == LUA_VUPVAL && upisopen(gco2upv(o))));
528 }
529 }
530 checkrefs(g, o);
531 }
532}
533
534
535static lu_mem checkgraylist (global_State *g, GCObject *o) {

Callers 2

checklistFunction · 0.85
lua_checkmemoryFunction · 0.85

Calls 1

checkrefsFunction · 0.85

Tested by

no test coverage detected