From 046a3d6173792b7d4d4d26a4e063e2fe383c10a7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 5 Oct 2000 10:00:17 -0300 Subject: tag methods are always functions, so don't need to store a whole object --- ltm.h | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'ltm.h') diff --git a/ltm.h b/ltm.h index c6de9e36..f72f9867 100644 --- a/ltm.h +++ b/ltm.h @@ -1,5 +1,5 @@ /* -** $Id: ltm.h,v 1.16 2000/10/03 14:27:44 roberto Exp roberto $ +** $Id: ltm.h,v 1.17 2000/10/05 12:14:08 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -13,36 +13,36 @@ /* * WARNING: if you change the order of this enumeration, -* grep "ORDER IM" +* grep "ORDER TM" */ typedef enum { - IM_GETTABLE = 0, - IM_SETTABLE, - IM_INDEX, - IM_GETGLOBAL, - IM_SETGLOBAL, - IM_ADD, - IM_SUB, - IM_MUL, - IM_DIV, - IM_POW, - IM_UNM, - IM_LT, - IM_CONCAT, - IM_GC, - IM_FUNCTION, - IM_N /* number of elements in the enum */ -} IMS; - - -struct IM { - TObject int_method[IM_N]; - TString *collected; /* list of G. collected udata with this tag */ + TM_GETTABLE = 0, + TM_SETTABLE, + TM_INDEX, + TM_GETGLOBAL, + TM_SETGLOBAL, + TM_ADD, + TM_SUB, + TM_MUL, + TM_DIV, + TM_POW, + TM_UNM, + TM_LT, + TM_CONCAT, + TM_GC, + TM_FUNCTION, + TM_N /* number of elements in the enum */ +} TMS; + + +struct TM { + Closure *method[TM_N]; + TString *collected; /* list of garbage-collected udata with this tag */ }; -#define luaT_getim(L,tag,event) (&L->IMtable[tag].int_method[event]) -#define luaT_getimbyObj(L,o,e) (luaT_getim((L),luaT_tag(o),(e))) +#define luaT_gettm(L,tag,event) (L->TMtable[tag].method[event]) +#define luaT_gettmbyObj(L,o,e) (luaT_gettm((L),luaT_tag(o),(e))) #define validtag(t) (NUM_TAGS <= (t) && (t) <= L->last_tag) -- cgit v1.2.3-55-g6feb