From 8ef9e8460e775793f760deb28d0c3d10dda31b49 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 30 Aug 2013 13:01:37 -0300 Subject: bug (GC can collect long identifier during parser) + change (using a single constant table for all functions in a chunk) --- ltable.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index a6dc17d9..f377c009 100644 --- a/ltable.h +++ b/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 2.16 2011/08/17 20:26:47 roberto Exp roberto $ +** $Id: ltable.h,v 2.17 2013/04/26 15:39:25 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -18,6 +18,11 @@ #define invalidateTMcache(t) ((t)->flags = 0) +/* returns the key, given the value of a table entry */ +#define keyfromval(v) \ + (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) + + LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value); -- cgit v1.2.3-55-g6feb