From 9243c414d92c253edd908f438caa31e2aa16f3f4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 23 Feb 2018 10:16:18 -0300 Subject: first version of empty entries in tables (so that, in the future, tables can contain regular nil entries) --- ltable.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index 88f90636..bcf92984 100644 --- a/ltable.h +++ b/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 2.24 2017/05/19 12:48:15 roberto Exp roberto $ +** $Id: ltable.h,v 2.25 2017/06/09 16:48:44 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -21,6 +21,8 @@ /* true when 't' is using 'dummynode' as its hash part */ #define isdummy(t) ((t)->lastfree == NULL) +#define luaH_emptyobject (&luaH_emptyobject_) + /* allocated size for hash nodes */ #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t)) @@ -30,6 +32,9 @@ #define nodefromval(v) cast(Node *, (v)) +LUAI_DDEC const TValue luaH_emptyobject_; + + 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