MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / iscleared

Function iscleared

Source/Misc/lua/src/lua.c:6339–6347  ·  view source on GitHub ↗

** The next function 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 userdata ** being finalized, keep them in keys, but not in values */

Source from the content-addressed store, hash-verified

6337** being finalized, keep them in keys, but not in values
6338*/
6339static int iscleared (const TValue *o, int iskey) {
6340if (!iscollectable(o)) return 0;
6341if (ttisstring(o)) {
6342stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */
6343return 0;
6344}
6345return iswhite(gcvalue(o)) ||
6346(ttisuserdata(o) && (!iskey && isfinalized(uvalue(o))));
6347}
6348
6349
6350/*

Callers 1

cleartableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected