diff options
Diffstat (limited to 'lfunc.h')
-rw-r--r-- | lfunc.h | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.h,v 2.14 2014/06/19 18:27:20 roberto Exp roberto $ | 2 | ** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -29,21 +29,6 @@ | |||
29 | #define MAXUPVAL 255 | 29 | #define MAXUPVAL 255 |
30 | 30 | ||
31 | 31 | ||
32 | /* | ||
33 | ** Upvalues for Lua closures | ||
34 | */ | ||
35 | struct UpVal { | ||
36 | TValue *v; /* points to stack or to its own value */ | ||
37 | lu_mem refcount; /* reference counter */ | ||
38 | union { | ||
39 | struct { /* (when open) */ | ||
40 | UpVal *next; /* linked list */ | ||
41 | int touched; /* mark to avoid cycles with dead threads */ | ||
42 | } open; | ||
43 | TValue value; /* the value (when closed) */ | ||
44 | } u; | ||
45 | }; | ||
46 | |||
47 | #define upisopen(up) ((up)->v != &(up)->u.value) | 32 | #define upisopen(up) ((up)->v != &(up)->u.value) |
48 | 33 | ||
49 | 34 | ||
@@ -53,6 +38,7 @@ LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); | |||
53 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); | 38 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); |
54 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); | 39 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); |
55 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); | 40 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); |
41 | LUAI_FUNC void luaF_unlinkupval (UpVal *uv); | ||
56 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); | 42 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); |
57 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, | 43 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, |
58 | int pc); | 44 | int pc); |