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