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

Function iscleared

extlibs/lua/src/lgc.c:173–180  ·  view source on GitHub ↗

** tells whether a key or value can be cleared from a weak ** table. Non-collectable objects are never removed from weak ** tables. Strings behave as 'values', so are never removed too. for ** other objects: if really collected, cannot keep them; for objects ** being finalized, keep them in keys, but not in values */

Source from the content-addressed store, hash-verified

171** being finalized, keep them in keys, but not in values
172*/
173static int iscleared (global_State *g, const GCObject *o) {
174 if (o == NULL) return 0; /* non-collectable value */
175 else if (novariant(o->tt) == LUA_TSTRING) {
176 markobject(g, o); /* strings are 'values', so are never weak */
177 return 0;
178 }
179 else return iswhite(o);
180}
181
182
183/*

Callers 4

traverseweakvalueFunction · 0.85
traverseephemeronFunction · 0.85
clearbykeysFunction · 0.85
clearbyvaluesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected