diff options
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.55 2010/03/22 18:28:03 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.56 2010/03/24 13:07:01 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 | */ |
@@ -114,9 +114,14 @@ typedef struct CallInfo { | |||
114 | ** `global state', shared by all threads of this state | 114 | ** `global state', shared by all threads of this state |
115 | */ | 115 | */ |
116 | typedef struct global_State { | 116 | typedef struct global_State { |
117 | stringtable strt; /* hash table for strings */ | ||
118 | lua_Alloc frealloc; /* function to reallocate memory */ | 117 | lua_Alloc frealloc; /* function to reallocate memory */ |
119 | void *ud; /* auxiliary data to `frealloc' */ | 118 | void *ud; /* auxiliary data to `frealloc' */ |
119 | lu_mem totalbytes; /* number of bytes currently allocated */ | ||
120 | lu_mem GCthreshold; /* when totalbytes > GCthreshold, run GC step */ | ||
121 | lu_mem lastmajormem; /* memory in use after last major collection */ | ||
122 | stringtable strt; /* hash table for strings */ | ||
123 | TValue l_registry; | ||
124 | struct Table *l_gt; /* table of globals */ | ||
120 | unsigned short nCcalls; /* number of nested C calls */ | 125 | unsigned short nCcalls; /* number of nested C calls */ |
121 | lu_byte currentwhite; | 126 | lu_byte currentwhite; |
122 | lu_byte gcstate; /* state of garbage collector */ | 127 | lu_byte gcstate; /* state of garbage collector */ |
@@ -131,16 +136,12 @@ typedef struct global_State { | |||
131 | GCObject *ephemeron; /* list of ephemeron tables (weak keys) */ | 136 | GCObject *ephemeron; /* list of ephemeron tables (weak keys) */ |
132 | GCObject *allweak; /* list of all-weak tables */ | 137 | GCObject *allweak; /* list of all-weak tables */ |
133 | GCObject *tobefnz; /* list of userdata to be GC */ | 138 | GCObject *tobefnz; /* list of userdata to be GC */ |
139 | UpVal uvhead; /* head of double-linked list of all open upvalues */ | ||
134 | Mbuffer buff; /* temporary buffer for string concatenation */ | 140 | Mbuffer buff; /* temporary buffer for string concatenation */ |
135 | lu_mem GCthreshold; /* when totalbytes > GCthreshold, run GC step */ | ||
136 | lu_mem totalbytes; /* number of bytes currently allocated */ | ||
137 | int gcpause; /* size of pause between successive GCs */ | 141 | int gcpause; /* size of pause between successive GCs */ |
138 | int gcstepmul; /* GC `granularity' */ | 142 | int gcstepmul; /* GC `granularity' */ |
139 | lua_CFunction panic; /* to be called in unprotected errors */ | 143 | lua_CFunction panic; /* to be called in unprotected errors */ |
140 | TValue l_registry; | ||
141 | struct Table *l_gt; /* table of globals */ | ||
142 | struct lua_State *mainthread; | 144 | struct lua_State *mainthread; |
143 | UpVal uvhead; /* head of double-linked list of all open upvalues */ | ||
144 | const lua_Number *version; /* pointer to version number */ | 145 | const lua_Number *version; /* pointer to version number */ |
145 | TString *envn; /* environment variable name */ | 146 | TString *envn; /* environment variable name */ |
146 | TString *tmname[TM_N]; /* array with tag-method names */ | 147 | TString *tmname[TM_N]; /* array with tag-method names */ |