** clear entries with unmarked values from all weaktables in list 'l' up ** to element 'f' */
| 681 | ** to element 'f' |
| 682 | */ |
| 683 | static void clearbyvalues (global_State *g, GCObject *l, GCObject *f) { |
| 684 | for (; l != f; l = gco2t(l)->gclist) { |
| 685 | Table *h = gco2t(l); |
| 686 | Node *n, *limit = gnodelast(h); |
| 687 | unsigned int i; |
| 688 | unsigned int asize = luaH_realasize(h); |
| 689 | for (i = 0; i < asize; i++) { |
| 690 | TValue *o = &h->array[i]; |
| 691 | if (iscleared(g, gcvalueN(o))) /* value was collected? */ |
| 692 | setempty(o); /* remove entry */ |
| 693 | } |
| 694 | for (n = gnode(h, 0); n < limit; n++) { |
| 695 | if (iscleared(g, gcvalueN(gval(n)))) /* unmarked value? */ |
| 696 | setempty(gval(n)); /* remove entry */ |
| 697 | if (isempty(gval(n))) /* is entry empty? */ |
| 698 | clearkey(n); /* clear its key */ |
| 699 | } |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | |
| 704 | static void freeupval (lua_State *L, UpVal *uv) { |
no test coverage detected