From 7c3cb71fa48fbe84d9d9c664eb646446fb80898b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 7 Aug 2020 11:21:44 -0300 Subject: Free bit 7 of GC 'marked' field Tables were using this bit to indicate their array sizes were real ('isrealasize'), but this bit can be useful for tests. Instead, they can use bit 7 of their 'flag' field for that purpose. (There are only six fast-access metamethods.) This 'flag' field only exists in tables, so this use does not affect other types. --- ltable.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index ebd7f8ec..c0060f4b 100644 --- a/ltable.h +++ b/ltable.h @@ -15,7 +15,12 @@ #define gnext(n) ((n)->u.next) -#define invalidateTMcache(t) ((t)->flags = 0) +/* +** Clear all bits of fast-access metamethods, which means that the table +** may have any of these metamethods. (First access that fails after the +** clearing will set the bit again.) +*/ +#define invalidateTMcache(t) ((t)->flags &= ~maskflags) /* true when 't' is using 'dummynode' as its hash part */ -- cgit v1.2.3-55-g6feb