aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-10-29 12:06:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-10-29 12:06:37 -0300
commit413a393e6222482f46599e138bebac162610a572 (patch)
tree181517f8ec8d56f9101de33f4891729044f244de /lstate.h
parentba089bcb08a0efc6c26fb5c1e3c9d61c00cc012c (diff)
downloadlua-413a393e6222482f46599e138bebac162610a572.tar.gz
lua-413a393e6222482f46599e138bebac162610a572.tar.bz2
lua-413a393e6222482f46599e138bebac162610a572.zip
Stack indices changed to union's
That will allow to change pointers to offsets while reallocating the stack.
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/lstate.h b/lstate.h
index 61e82cde..2e907818 100644
--- a/lstate.h
+++ b/lstate.h
@@ -139,7 +139,7 @@ struct lua_longjmp; /* defined in ldo.c */
139 139
140#define BASIC_STACK_SIZE (2*LUA_MINSTACK) 140#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
141 141
142#define stacksize(th) cast_int((th)->stack_last - (th)->stack) 142#define stacksize(th) cast_int((th)->stack_last.p - (th)->stack.p)
143 143
144 144
145/* kinds of Garbage Collection */ 145/* kinds of Garbage Collection */
@@ -170,8 +170,8 @@ typedef struct stringtable {
170** before the function starts or after it ends. 170** before the function starts or after it ends.
171*/ 171*/
172typedef struct CallInfo { 172typedef struct CallInfo {
173 StkId func; /* function index in the stack */ 173 StkIdRel func; /* function index in the stack */
174 StkId top; /* top for this function */ 174 StkIdRel top; /* top for this function */
175 struct CallInfo *previous, *next; /* dynamic call link */ 175 struct CallInfo *previous, *next; /* dynamic call link */
176 union { 176 union {
177 struct { /* only for Lua functions */ 177 struct { /* only for Lua functions */
@@ -306,13 +306,13 @@ struct lua_State {
306 lu_byte status; 306 lu_byte status;
307 lu_byte allowhook; 307 lu_byte allowhook;
308 unsigned short nci; /* number of items in 'ci' list */ 308 unsigned short nci; /* number of items in 'ci' list */
309 StkId top; /* first free slot in the stack */ 309 StkIdRel top; /* first free slot in the stack */
310 global_State *l_G; 310 global_State *l_G;
311 CallInfo *ci; /* call info for current function */ 311 CallInfo *ci; /* call info for current function */
312 StkId stack_last; /* end of stack (last element + 1) */ 312 StkIdRel stack_last; /* end of stack (last element + 1) */
313 StkId stack; /* stack base */ 313 StkIdRel stack; /* stack base */
314 UpVal *openupval; /* list of open upvalues in this stack */ 314 UpVal *openupval; /* list of open upvalues in this stack */
315 StkId tbclist; /* list of to-be-closed variables */ 315 StkIdRel tbclist; /* list of to-be-closed variables */
316 GCObject *gclist; 316 GCObject *gclist;
317 struct lua_State *twups; /* list of threads with open upvalues */ 317 struct lua_State *twups; /* list of threads with open upvalues */
318 struct lua_longjmp *errorJmp; /* current error recover point */ 318 struct lua_longjmp *errorJmp; /* current error recover point */