summaryrefslogtreecommitdiff
path: root/libs/liblua/src/ltable.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/ltable.h')
-rw-r--r--libs/liblua/src/ltable.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/liblua/src/ltable.h b/libs/liblua/src/ltable.h
index 213cc13987..bd3543b530 100644
--- a/libs/liblua/src/ltable.h
+++ b/libs/liblua/src/ltable.h
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.h,v 2.21 2015/11/03 15:47:30 roberto Exp $
+** $Id: ltable.h,v 2.22 2016/11/07 12:38:35 roberto Exp roberto $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -15,7 +15,7 @@
#define gnext(n) ((n)->i_key.nk.next)
-/* 'const' to avoid wrong writings that can mess up field 'next' */
+/* 'const' to avoid wrong writings that can mess up field 'next' */
#define gkey(n) cast(const TValue*, (&(n)->i_key.tvk))
/*
@@ -27,6 +27,14 @@
#define invalidateTMcache(t) ((t)->flags = 0)
+/* true when 't' is using 'dummynode' as its hash part */
+#define isdummy(t) ((t)->lastfree == NULL)
+
+
+/* allocated size for hash nodes */
+#define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t))
+
+
/* returns the key, given the value of a table entry */
#define keyfromval(v) \
(gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))
@@ -51,7 +59,7 @@ LUAI_FUNC int luaH_getn (Table *t);
#if defined(LUA_DEBUG)
LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
-LUAI_FUNC int luaH_isdummy (Node *n);
+LUAI_FUNC int luaH_isdummy (const Table *t);
#endif