diff options
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.40 2009/03/23 14:26:12 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.41 2009/04/08 18:04:33 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 | */ |
@@ -80,8 +80,9 @@ typedef struct CallInfo { | |||
80 | StkId base; /* base for this function */ | 80 | StkId base; /* base for this function */ |
81 | StkId func; /* function index in the stack */ | 81 | StkId func; /* function index in the stack */ |
82 | StkId top; /* top for this function */ | 82 | StkId top; /* top for this function */ |
83 | struct CallInfo *previous, *next; /* dynamic call link */ | ||
83 | const Instruction *savedpc; | 84 | const Instruction *savedpc; |
84 | short nresults; /* expected number of results from this function */ | 85 | short nresults; /* expected number of results from a call */ |
85 | lu_byte callstatus; | 86 | lu_byte callstatus; |
86 | union { | 87 | union { |
87 | struct { /* only for Lua functions */ | 88 | struct { /* only for Lua functions */ |
@@ -163,14 +164,12 @@ struct lua_State { | |||
163 | StkId base; /* base of current function */ | 164 | StkId base; /* base of current function */ |
164 | global_State *l_G; | 165 | global_State *l_G; |
165 | CallInfo *ci; /* call info for current function */ | 166 | CallInfo *ci; /* call info for current function */ |
167 | int nci; /* number of total CallInfo structures linked */ | ||
166 | const Instruction *savedpc; /* `savedpc' of current function */ | 168 | const Instruction *savedpc; /* `savedpc' of current function */ |
167 | const Instruction *oldpc; /* last pc traced */ | 169 | const Instruction *oldpc; /* last pc traced */ |
168 | StkId stack_last; /* last free slot in the stack */ | 170 | StkId stack_last; /* last free slot in the stack */ |
169 | StkId stack; /* stack base */ | 171 | StkId stack; /* stack base */ |
170 | CallInfo *end_ci; /* points after end of ci array*/ | ||
171 | CallInfo *base_ci; /* array of CallInfo's */ | ||
172 | int stacksize; | 172 | int stacksize; |
173 | int size_ci; /* size of array `base_ci' */ | ||
174 | unsigned short nny; /* number of non-yieldable calls in stack */ | 173 | unsigned short nny; /* number of non-yieldable calls in stack */ |
175 | lu_byte hookmask; | 174 | lu_byte hookmask; |
176 | lu_byte allowhook; | 175 | lu_byte allowhook; |
@@ -183,6 +182,7 @@ struct lua_State { | |||
183 | GCObject *gclist; | 182 | GCObject *gclist; |
184 | struct lua_longjmp *errorJmp; /* current error recover point */ | 183 | struct lua_longjmp *errorJmp; /* current error recover point */ |
185 | ptrdiff_t errfunc; /* current error handling function (stack index) */ | 184 | ptrdiff_t errfunc; /* current error handling function (stack index) */ |
185 | CallInfo base_ci; /* CallInfo for first level (C calling Lua) */ | ||
186 | }; | 186 | }; |
187 | 187 | ||
188 | 188 | ||
@@ -223,6 +223,9 @@ union GCObject { | |||
223 | 223 | ||
224 | 224 | ||
225 | LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); | 225 | LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); |
226 | LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); | ||
227 | LUAI_FUNC void luaE_freeCI (lua_State *L); | ||
228 | |||
226 | 229 | ||
227 | #endif | 230 | #endif |
228 | 231 | ||