** Get the next udata to be finalized from the 'tobefnz' list, and ** link it back into the 'allgc' list. */
| 876 | ** link it back into the 'allgc' list. |
| 877 | */ |
| 878 | static GCObject *udata2finalize (global_State *g) { |
| 879 | GCObject *o = g->tobefnz; /* get first element */ |
| 880 | lua_assert(tofinalize(o)); |
| 881 | g->tobefnz = o->next; /* remove it from 'tobefnz' list */ |
| 882 | o->next = g->allgc; /* return it to 'allgc' list */ |
| 883 | g->allgc = o; |
| 884 | resetbit(o->marked, FINALIZEDBIT); /* object is "normal" again */ |
| 885 | if (issweepphase(g)) |
| 886 | makewhite(g, o); /* "sweep" object */ |
| 887 | else if (getage(o) == G_OLD1) |
| 888 | g->firstold1 = o; /* it is the first OLD1 object in the list */ |
| 889 | return o; |
| 890 | } |
| 891 | |
| 892 | |
| 893 | static void dothecall (lua_State *L, void *ud) { |