From 9b7a12c46d85666e0e60efd79b39495589e497e8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Nov 2010 12:32:31 -0200 Subject: finalizers (__gc) for tables --- lobject.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index a23cc560..b9e554b4 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.41 2010/06/04 13:25:10 roberto Exp roberto $ +** $Id: lobject.h,v 2.42 2010/07/26 15:53:23 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -153,6 +153,10 @@ typedef struct lua_TValue { #define setbvalue(obj,x) \ { TValue *i_o=(obj); i_o->value_.b=(x); i_o->tt_=LUA_TBOOLEAN; } +#define setgcovalue(L,obj,x) \ + { TValue *i_o=(obj); GCObject *i_g=(x); \ + i_o->value_.gc=i_g; i_o->tt_=gch(i_g)->tt; } + #define setsvalue(L,obj,x) \ { TValue *i_o=(obj); \ i_o->value_.gc=cast(GCObject *, (x)); i_o->tt_=LUA_TSTRING; \ -- cgit v1.2.3-55-g6feb