From 4433dbb5f5ac0bb6118bc49ddf061f194c070814 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 24 Mar 2010 10:07:01 -0300 Subject: userdata with finalizers are kept in a separated list ('udgc'), instead of at the end of 'rootgc' (which was renamed to 'allgc', as it is not "root" in the usual meaning for collectors) --- lstate.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index ebf4e4af..45eccf8a 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.54 2010/03/13 15:55:42 roberto Exp roberto $ +** $Id: lstate.h,v 2.55 2010/03/22 18:28:03 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -19,7 +19,7 @@ ** Some notes about garbage-collected objects: All objects in Lua must ** be kept somehow accessible until being freed. ** -** Lua keeps most objects linked in list g->rootgc. The link uses field +** Lua keeps most objects linked in list g->allgc. The link uses field ** 'next' of the CommonHeader. ** ** Strings are kept in several lists headed by the array g->strt.hash. @@ -32,9 +32,7 @@ ** when traversing the respective threads, but the thread may already be ** dead, while the upvalue is still accessible through closures.) ** -** Userdata with finalizers are kept in the list g->rootgc, but after -** the mainthread, which should be otherwise the last element in the -** list, as it was the first one inserted there. +** Userdata with finalizers are kept in the list g->udgc. ** ** The list g->tobefnz links all userdata being finalized. @@ -124,7 +122,8 @@ typedef struct global_State { lu_byte gcstate; /* state of garbage collector */ lu_byte gckind; /* kind of GC running */ int sweepstrgc; /* position of sweep in `strt' */ - GCObject *rootgc; /* list of all collectable objects */ + GCObject *allgc; /* list of all collectable objects */ + GCObject *udgc; /* list of collectable userdata with finalizers */ GCObject **sweepgc; /* current position of sweep */ GCObject *gray; /* list of gray objects */ GCObject *grayagain; /* list of objects to be traversed atomically */ -- cgit v1.2.3-55-g6feb