diff options
Diffstat (limited to 'source/luametatex/source/luacore/lua54/src/lobject.h')
-rw-r--r-- | source/luametatex/source/luacore/lua54/src/lobject.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/luametatex/source/luacore/lua54/src/lobject.h b/source/luametatex/source/luacore/lua54/src/lobject.h index 77cc606f5..556608e4a 100644 --- a/source/luametatex/source/luacore/lua54/src/lobject.h +++ b/source/luametatex/source/luacore/lua54/src/lobject.h @@ -157,6 +157,17 @@ typedef union StackValue { /* index to stack elements */ typedef StackValue *StkId; + +/* +** When reallocating the stack, change all pointers to the stack into +** proper offsets. +*/ +typedef union { + StkId p; /* actual pointer */ + ptrdiff_t offset; /* used while the stack is being reallocated */ +} StkIdRel; + + /* convert a 'StackValue' to a 'TValue' */ #define s2v(o) (&(o)->val) @@ -617,8 +628,10 @@ typedef struct Proto { */ typedef struct UpVal { CommonHeader; - lu_byte tbc; /* true if it represents a to-be-closed variable */ - TValue *v; /* points to stack or to its own value */ + union { + TValue *p; /* points to stack or to its own value */ + ptrdiff_t offset; /* used while the stack is being reallocated */ + } v; union { struct { /* (when open) */ struct UpVal *next; /* linked list */ |