** clear entries with unmarked keys from all weaktables in list 'l' */
| 787 | ** clear entries with unmarked keys from all weaktables in list 'l' |
| 788 | */ |
| 789 | static void clearbykeys (global_State *g, GCObject *l) { |
| 790 | for (; l; l = gco2t(l)->gclist) { |
| 791 | Table *h = gco2t(l); |
| 792 | Node *limit = gnodelast(h); |
| 793 | Node *n; |
| 794 | for (n = gnode(h, 0); n < limit; n++) { |
| 795 | if (iscleared(g, gckeyN(n))) /* unmarked key? */ |
| 796 | setempty(gval(n)); /* remove entry */ |
| 797 | if (isempty(gval(n))) /* is entry empty? */ |
| 798 | clearkey(n); /* clear its key */ |
| 799 | } |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | |
| 804 | /* |