** clear entries with unmarked keys from all weaktables in list 'l' */
| 662 | ** clear entries with unmarked keys from all weaktables in list 'l' |
| 663 | */ |
| 664 | static void clearbykeys (global_State *g, GCObject *l) { |
| 665 | for (; l; l = gco2t(l)->gclist) { |
| 666 | Table *h = gco2t(l); |
| 667 | Node *limit = gnodelast(h); |
| 668 | Node *n; |
| 669 | for (n = gnode(h, 0); n < limit; n++) { |
| 670 | if (iscleared(g, gckeyN(n))) /* unmarked key? */ |
| 671 | setempty(gval(n)); /* remove entry */ |
| 672 | if (isempty(gval(n))) /* is entry empty? */ |
| 673 | clearkey(n); /* clear its key */ |
| 674 | } |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | |
| 679 | /* |