use lua_mem(L, +-size) to track your additional userdata sizes. keep it balanced...
[blua.git] / src / ltm.h
blob93de985280a338295a6011940bcb05aa76b51806
1 /*
2 ** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
3 ** Tag methods
4 ** See Copyright Notice in lua.h
5 */
7 #ifndef ltm_h
8 #define ltm_h
11 #include "lobject.h"
15 * WARNING: if you change the order of this enumeration,
16 * grep "ORDER TM"
18 typedef enum {
19 TM_INDEX,
20 TM_NEWINDEX,
21 TM_USEDINDEX,
22 TM_GC,
23 TM_MODE,
24 TM_EQ, /* last tag method with `fast' access */
25 TM_ADD,
26 TM_SUB,
27 TM_MUL,
28 TM_DIV,
29 TM_MOD,
30 TM_POW,
31 TM_UNM,
32 TM_LEN,
33 TM_LT,
34 TM_LE,
35 TM_CONCAT,
36 TM_CALL,
37 TM_STRHOOK,
38 TM_AND,
39 TM_OR,
40 TM_XOR,
41 TM_SHL,
42 TM_SHR,
43 TM_NOT,
44 TM_N /* number of elements in the enum */
45 } TMS;
49 #define gfasttm(g,et,e) ((et) == NULL ? NULL : \
50 ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
52 #define fasttm(l,et,e) gfasttm(G(l), et, e)
54 LUAI_DATA const char *const luaT_typenames[];
57 LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
58 LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
59 TMS event);
60 LUAI_FUNC void luaT_init (lua_State *L);
62 #endif