diff options
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.54 2010/03/13 15:55:42 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.55 2010/03/22 18:28:03 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -19,7 +19,7 @@ | |||
19 | ** Some notes about garbage-collected objects: All objects in Lua must | 19 | ** Some notes about garbage-collected objects: All objects in Lua must |
20 | ** be kept somehow accessible until being freed. | 20 | ** be kept somehow accessible until being freed. |
21 | ** | 21 | ** |
22 | ** Lua keeps most objects linked in list g->rootgc. The link uses field | 22 | ** Lua keeps most objects linked in list g->allgc. The link uses field |
23 | ** 'next' of the CommonHeader. | 23 | ** 'next' of the CommonHeader. |
24 | ** | 24 | ** |
25 | ** Strings are kept in several lists headed by the array g->strt.hash. | 25 | ** Strings are kept in several lists headed by the array g->strt.hash. |
@@ -32,9 +32,7 @@ | |||
32 | ** when traversing the respective threads, but the thread may already be | 32 | ** when traversing the respective threads, but the thread may already be |
33 | ** dead, while the upvalue is still accessible through closures.) | 33 | ** dead, while the upvalue is still accessible through closures.) |
34 | ** | 34 | ** |
35 | ** Userdata with finalizers are kept in the list g->rootgc, but after | 35 | ** Userdata with finalizers are kept in the list g->udgc. |
36 | ** the mainthread, which should be otherwise the last element in the | ||
37 | ** list, as it was the first one inserted there. | ||
38 | ** | 36 | ** |
39 | ** The list g->tobefnz links all userdata being finalized. | 37 | ** The list g->tobefnz links all userdata being finalized. |
40 | 38 | ||
@@ -124,7 +122,8 @@ typedef struct global_State { | |||
124 | lu_byte gcstate; /* state of garbage collector */ | 122 | lu_byte gcstate; /* state of garbage collector */ |
125 | lu_byte gckind; /* kind of GC running */ | 123 | lu_byte gckind; /* kind of GC running */ |
126 | int sweepstrgc; /* position of sweep in `strt' */ | 124 | int sweepstrgc; /* position of sweep in `strt' */ |
127 | GCObject *rootgc; /* list of all collectable objects */ | 125 | GCObject *allgc; /* list of all collectable objects */ |
126 | GCObject *udgc; /* list of collectable userdata with finalizers */ | ||
128 | GCObject **sweepgc; /* current position of sweep */ | 127 | GCObject **sweepgc; /* current position of sweep */ |
129 | GCObject *gray; /* list of gray objects */ | 128 | GCObject *gray; /* list of gray objects */ |
130 | GCObject *grayagain; /* list of objects to be traversed atomically */ | 129 | GCObject *grayagain; /* list of objects to be traversed atomically */ |