aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-04-11 15:41:09 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-04-11 15:41:09 -0300
commita3d36fe283c09d4e56474da98f22d13162cc9fec (patch)
tree1f6e2ed56d50dc14aa669fa5f31a63755abd4553 /lobject.h
parent9569ad6b0ddcde43eb893d2cfe5bcdb715c0ff20 (diff)
downloadlua-a3d36fe283c09d4e56474da98f22d13162cc9fec.tar.gz
lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.tar.bz2
lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.zip
Upvalues collected like everything else (with mark-sweep) instead
of reference count (simpler and better for generational mode)
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/lobject.h b/lobject.h
index eeddfdef..7c521ba2 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.116 2015/11/03 18:33:10 roberto Exp roberto $ 2** $Id: lobject.h,v 2.117 2016/08/01 19:51:24 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -19,8 +19,9 @@
19/* 19/*
20** Extra tags for non-values 20** Extra tags for non-values
21*/ 21*/
22#define LUA_TPROTO LUA_NUMTAGS /* function prototypes */ 22#define LUA_TUPVAL LUA_NUMTAGS /* upvalues */
23#define LUA_TDEADKEY (LUA_NUMTAGS+1) /* removed keys in tables */ 23#define LUA_TPROTO (LUA_NUMTAGS+1) /* function prototypes */
24#define LUA_TDEADKEY (LUA_NUMTAGS+2) /* removed keys in tables */
24 25
25/* 26/*
26** number of all possible tags (including LUA_TNONE but excluding DEADKEY) 27** number of all possible tags (including LUA_TNONE but excluding DEADKEY)
@@ -431,9 +432,20 @@ typedef struct Proto {
431 432
432 433
433/* 434/*
434** Lua Upvalues 435** Upvalues for Lua closures
435*/ 436*/
436typedef struct UpVal UpVal; 437typedef struct UpVal {
438 CommonHeader;
439 TValue *v; /* points to stack or to its own value */
440 union {
441 struct { /* (when open) */
442 struct UpVal *next; /* linked list */
443 struct UpVal **previous;
444 } open;
445 TValue value; /* the value (when closed) */
446 } u;
447} UpVal;
448
437 449
438 450
439/* 451/*