** check color (and invariants) for an upvalue that was closed, ** i.e., moved into the 'allgc' list */
| 187 | ** i.e., moved into the 'allgc' list |
| 188 | */ |
| 189 | void luaC_checkupvalcolor (global_State *g, UpVal *uv) { |
| 190 | GCObject *o = obj2gco(uv); |
| 191 | lua_assert(!isblack(o)); /* open upvalues are never black */ |
| 192 | if (isgray(o)) { |
| 193 | if (keepinvariant(g)) { |
| 194 | resetoldbit(o); /* see MOVE OLD rule */ |
| 195 | gray2black(o); /* it is being visited now */ |
| 196 | markvalue(g, uv->v); |
| 197 | } |
| 198 | else { |
| 199 | lua_assert(issweepphase(g)); |
| 200 | makewhite(g, o); |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | |
| 206 | /* |