first version of empty entries in tables

(so that, in the future, tables can contain regular nil entries)
This commit is contained in:
Roberto Ierusalimschy
2018-02-23 10:16:18 -03:00
parent 477ca2fe8c
commit 9243c414d9
11 changed files with 146 additions and 99 deletions

View File

@@ -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);