** 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 */
| 171 | ** being finalized, keep them in keys, but not in values |
| 172 | */ |
| 173 | static 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 | /* |
no outgoing calls
no test coverage detected