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.
This commit is contained in:
Roberto Ierusalimschy
2022-11-01 15:42:08 -03:00
parent ee645472eb
commit 8047b2d03e
7 changed files with 84 additions and 24 deletions

View File

@@ -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 */