MCPcopy Create free account
hub / github.com/DFHack/dfhack / iscleared

Function iscleared

depends/lua/src/lgc.c:139–146  ·  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

137** being finalized, keep them in keys, but not in values
138*/
139static int iscleared (global_State *g, const TValue *o) {
140 if (!iscollectable(o)) return 0;
141 else if (ttisstring(o)) {
142 markobject(g, tsvalue(o)); /* strings are 'values', so are never weak */
143 return 0;
144 }
145 else return iswhite(gcvalue(o));
146}
147
148
149/*

Callers 4

traverseweakvalueFunction · 0.85
traverseephemeronFunction · 0.85
clearkeysFunction · 0.85
clearvaluesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected