diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-11-26 12:32:31 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-11-26 12:32:31 -0200 |
commit | 9b7a12c46d85666e0e60efd79b39495589e497e8 (patch) | |
tree | c69acde3d3e300fa0db87004045e7599cbbca7a2 /lobject.h | |
parent | 5b33e398557d7afad4a916bb483e9894e4b9b3d4 (diff) | |
download | lua-9b7a12c46d85666e0e60efd79b39495589e497e8.tar.gz lua-9b7a12c46d85666e0e60efd79b39495589e497e8.tar.bz2 lua-9b7a12c46d85666e0e60efd79b39495589e497e8.zip |
finalizers (__gc) for tables
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.41 2010/06/04 13:25:10 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.42 2010/07/26 15:53:23 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 | */ |
@@ -153,6 +153,10 @@ typedef struct lua_TValue { | |||
153 | #define setbvalue(obj,x) \ | 153 | #define setbvalue(obj,x) \ |
154 | { TValue *i_o=(obj); i_o->value_.b=(x); i_o->tt_=LUA_TBOOLEAN; } | 154 | { TValue *i_o=(obj); i_o->value_.b=(x); i_o->tt_=LUA_TBOOLEAN; } |
155 | 155 | ||
156 | #define setgcovalue(L,obj,x) \ | ||
157 | { TValue *i_o=(obj); GCObject *i_g=(x); \ | ||
158 | i_o->value_.gc=i_g; i_o->tt_=gch(i_g)->tt; } | ||
159 | |||
156 | #define setsvalue(L,obj,x) \ | 160 | #define setsvalue(L,obj,x) \ |
157 | { TValue *i_o=(obj); \ | 161 | { TValue *i_o=(obj); \ |
158 | i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TSTRING; \ | 162 | i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TSTRING; \ |