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 /lfunc.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 'lfunc.h')
-rw-r--r-- | lfunc.h | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -42,15 +42,9 @@ | |||
42 | #define MAXMISS 10 | 42 | #define MAXMISS 10 |
43 | 43 | ||
44 | 44 | ||
45 | /* | ||
46 | ** Special "status" for 'luaF_close' | ||
47 | */ | ||
48 | |||
49 | /* close upvalues without running their closing methods */ | ||
50 | #define NOCLOSINGMETH (-1) | ||
51 | 45 | ||
52 | /* special status to close upvalues preserving the top of the stack */ | 46 | /* special status to close upvalues preserving the top of the stack */ |
53 | #define CLOSEKTOP (-2) | 47 | #define CLOSEKTOP (-1) |
54 | 48 | ||
55 | 49 | ||
56 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); | 50 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); |
@@ -59,6 +53,7 @@ LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nupvals); | |||
59 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); | 53 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); |
60 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); | 54 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); |
61 | LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); | 55 | LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); |
56 | LUAI_FUNC void luaF_closeupval (lua_State *L, StkId level); | ||
62 | LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status, int yy); | 57 | LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status, int yy); |
63 | LUAI_FUNC void luaF_unlinkupval (UpVal *uv); | 58 | LUAI_FUNC void luaF_unlinkupval (UpVal *uv); |
64 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); | 59 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); |