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