** clear entries with unmarked keys from all weaktables in list 'l' */
| 723 | ** clear entries with unmarked keys from all weaktables in list 'l' |
| 724 | */ |
| 725 | static void clearbykeys (global_State *g, GCObject *l) { |
| 726 | for (; l; l = gco2t(l)->gclist) { |
| 727 | Table *h = gco2t(l); |
| 728 | Node *limit = gnodelast(h); |
| 729 | Node *n; |
| 730 | for (n = gnode(h, 0); n < limit; n++) { |
| 731 | if (iscleared(g, gckeyN(n))) /* unmarked key? */ |
| 732 | setempty(gval(n)); /* remove entry */ |
| 733 | if (isempty(gval(n))) /* is entry empty? */ |
| 734 | clearkey(n); /* clear its key */ |
| 735 | } |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | |
| 740 | /* |