diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-09 14:00:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-09 14:00:05 -0300 |
commit | 4e47f81188d37e29027158b76271d02a781242e2 (patch) | |
tree | c360912d1901acf8371390cc1f716278e5d91bb4 /lobject.h | |
parent | c63e5d212bc5dec1b1c749e3f07b42cd83081826 (diff) | |
download | lua-4e47f81188d37e29027158b76271d02a781242e2.tar.gz lua-4e47f81188d37e29027158b76271d02a781242e2.tar.bz2 lua-4e47f81188d37e29027158b76271d02a781242e2.zip |
New implementation for to-be-closed variables
To-be-closed variables are linked in their own list, embedded into the
stack elements. (Due to alignment, this information does not change
the size of the stack elements in most architectures.) This new list
does not produce garbage and avoids memory errors when creating tbc
variables.
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -136,10 +136,18 @@ typedef struct TValue { | |||
136 | 136 | ||
137 | 137 | ||
138 | /* | 138 | /* |
139 | ** Entries in the Lua stack | 139 | ** Entries in a Lua stack. Field 'tbclist' forms a list of all |
140 | ** to-be-closed variables active in this stack. Dummy entries are | ||
141 | ** used when the distance between two tbc variables does not fit | ||
142 | ** in an unsigned short. | ||
140 | */ | 143 | */ |
141 | typedef union StackValue { | 144 | typedef union StackValue { |
142 | TValue val; | 145 | TValue val; |
146 | struct { | ||
147 | TValuefields; | ||
148 | lu_byte isdummy; | ||
149 | unsigned short delta; | ||
150 | } tbclist; | ||
143 | } StackValue; | 151 | } StackValue; |
144 | 152 | ||
145 | 153 | ||