** clear entries with unmarked values from all weaktables in list 'l' up ** to element 'f' */
| 656 | ** to element 'f' |
| 657 | */ |
| 658 | static void clearvalues (global_State *g, GCObject *l, GCObject *f) { |
| 659 | for (; l != f; l = gco2t(l)->gclist) { |
| 660 | Table *h = gco2t(l); |
| 661 | Node *n, *limit = gnodelast(h); |
| 662 | unsigned int i; |
| 663 | for (i = 0; i < h->sizearray; i++) { |
| 664 | TValue *o = &h->array[i]; |
| 665 | if (iscleared(g, o)) /* value was collected? */ |
| 666 | setnilvalue(o); /* remove value */ |
| 667 | } |
| 668 | for (n = gnode(h, 0); n < limit; n++) { |
| 669 | if (!ttisnil(gval(n)) && iscleared(g, gval(n))) { |
| 670 | setnilvalue(gval(n)); /* remove value ... */ |
| 671 | removeentry(n); /* and remove entry from table */ |
| 672 | } |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | |
| 677 | |
| 678 | void luaC_upvdeccount (lua_State *L, UpVal *uv) { |
no test coverage detected