** Get the next udata to be finalized from the 'tobefnz' list, and ** link it back into the 'allgc' list. */
| 815 | ** link it back into the 'allgc' list. |
| 816 | */ |
| 817 | static GCObject *udata2finalize (global_State *g) { |
| 818 | GCObject *o = g->tobefnz; /* get first element */ |
| 819 | lua_assert(tofinalize(o)); |
| 820 | g->tobefnz = o->next; /* remove it from 'tobefnz' list */ |
| 821 | o->next = g->allgc; /* return it to 'allgc' list */ |
| 822 | g->allgc = o; |
| 823 | resetbit(o->marked, FINALIZEDBIT); /* object is "normal" again */ |
| 824 | if (issweepphase(g)) |
| 825 | makewhite(g, o); /* "sweep" object */ |
| 826 | return o; |
| 827 | } |
| 828 | |
| 829 | |
| 830 | static void dothecall (lua_State *L, void *ud) { |