** clear entries with unmarked values from all weaktables in list 'l' up ** to element 'f' */
| 641 | ** to element 'f' |
| 642 | */ |
| 643 | static void clearvalues (global_State *g, GCObject *l, GCObject *f) { |
| 644 | for (; l != f; l = gco2t(l)->gclist) { |
| 645 | Table *h = gco2t(l); |
| 646 | Node *n, *limit = gnodelast(h); |
| 647 | int i; |
| 648 | for (i = 0; i < h->sizearray; i++) { |
| 649 | TValue *o = &h->array[i]; |
| 650 | if (iscleared(g, o)) /* value was collected? */ |
| 651 | setnilvalue(o); /* remove value */ |
| 652 | } |
| 653 | for (n = gnode(h, 0); n < limit; n++) { |
| 654 | if (!ttisnil(gval(n)) && iscleared(g, gval(n))) { |
| 655 | setnilvalue(gval(n)); /* remove value ... */ |
| 656 | removeentry(n); /* and remove entry from table */ |
| 657 | } |
| 658 | } |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | |
| 663 | static void freeobj (lua_State *L, GCObject *o) { |
no test coverage detected