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