diff options
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -127,12 +127,20 @@ struct lua_longjmp; /* defined in ldo.c */ | |||
127 | #endif | 127 | #endif |
128 | 128 | ||
129 | 129 | ||
130 | /* extra stack space to handle TM calls and some other extras */ | 130 | /* |
131 | ** Extra stack space to handle TM calls and some other extras. This | ||
132 | ** space is not included in 'stack_last'. It is used only to avoid stack | ||
133 | ** checks, either because the element will be promptly popped or because | ||
134 | ** there will be a stack check soon after the push. Function frames | ||
135 | ** never use this extra space, so it does not need to be kept clean. | ||
136 | */ | ||
131 | #define EXTRA_STACK 5 | 137 | #define EXTRA_STACK 5 |
132 | 138 | ||
133 | 139 | ||
134 | #define BASIC_STACK_SIZE (2*LUA_MINSTACK) | 140 | #define BASIC_STACK_SIZE (2*LUA_MINSTACK) |
135 | 141 | ||
142 | #define stacksize(th) cast_int((th)->stack_last - (th)->stack) | ||
143 | |||
136 | 144 | ||
137 | /* kinds of Garbage Collection */ | 145 | /* kinds of Garbage Collection */ |
138 | #define KGC_INC 0 /* incremental gc */ | 146 | #define KGC_INC 0 /* incremental gc */ |
@@ -270,7 +278,7 @@ struct lua_State { | |||
270 | StkId top; /* first free slot in the stack */ | 278 | StkId top; /* first free slot in the stack */ |
271 | global_State *l_G; | 279 | global_State *l_G; |
272 | CallInfo *ci; /* call info for current function */ | 280 | CallInfo *ci; /* call info for current function */ |
273 | StkId stack_last; /* last free slot in the stack */ | 281 | StkId stack_last; /* end of stack (last element + 1) */ |
274 | StkId stack; /* stack base */ | 282 | StkId stack; /* stack base */ |
275 | UpVal *openupval; /* list of open upvalues in this stack */ | 283 | UpVal *openupval; /* list of open upvalues in this stack */ |
276 | GCObject *gclist; | 284 | GCObject *gclist; |
@@ -281,7 +289,6 @@ struct lua_State { | |||
281 | ptrdiff_t errfunc; /* current error handling function (stack index) */ | 289 | ptrdiff_t errfunc; /* current error handling function (stack index) */ |
282 | l_uint32 nCcalls; /* number of nested (non-yieldable | C) calls */ | 290 | l_uint32 nCcalls; /* number of nested (non-yieldable | C) calls */ |
283 | int oldpc; /* last pc traced */ | 291 | int oldpc; /* last pc traced */ |
284 | int stacksize; | ||
285 | int basehookcount; | 292 | int basehookcount; |
286 | int hookcount; | 293 | int hookcount; |
287 | volatile l_signalT hookmask; | 294 | volatile l_signalT hookmask; |