MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / iscleared

Function iscleared

third-party/lua-5.4.6/src/lgc.c:185–192  ·  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

183** being finalized, keep them in keys, but not in values
184*/
185static int iscleared (global_State *g, const GCObject *o) {
186 if (o == NULL) return 0; /* non-collectable value */
187 else if (novariant(o->tt) == LUA_TSTRING) {
188 markobject(g, o); /* strings are 'values', so are never weak */
189 return 0;
190 }
191 else return iswhite(o);
192}
193
194
195/*

Callers 4

traverseweakvalueFunction · 0.70
traverseephemeronFunction · 0.70
clearbykeysFunction · 0.70
clearbyvaluesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected