From 8047b2d03eaaeee44871a11f8d3a3135f2639b1a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 1 Nov 2022 15:42:08 -0300 Subject: Tables have a 'lastfree' information only when needed Only tables with some minimum number of entries in their hash part have a 'lastfree' field, kept in a header before the node vector. --- ltable.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index 75dd9e26..dce8c2f7 100644 --- a/ltable.h +++ b/ltable.h @@ -23,8 +23,18 @@ #define invalidateTMcache(t) ((t)->flags &= ~maskflags) -/* true when 't' is using 'dummynode' as its hash part */ -#define isdummy(t) ((t)->lastfree == NULL) +/* +** Bit BITDUMMY set in 'flags' means the table is using the dummy node +** for its hash part. +*/ + +#define BITDUMMY (1 << 6) +#define NOTBITDUMMY cast_byte(~BITDUMMY) +#define isdummy(t) ((t)->flags & BITDUMMY) + +#define setnodummy(t) ((t)->flags &= NOTBITDUMMY) +#define setdummy(t) ((t)->flags |= BITDUMMY) + /* allocated size for hash nodes */ -- cgit v1.2.3-55-g6feb