diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-08-07 11:21:44 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-08-07 11:21:44 -0300 |
commit | 7c3cb71fa48fbe84d9d9c664eb646446fb80898b (patch) | |
tree | 43d2b2282853b882877e42a0b8ec7467c9bb0e9e /ltable.h | |
parent | 68109afcdb59a7eeb75bacf055abce3e56a53645 (diff) | |
download | lua-7c3cb71fa48fbe84d9d9c664eb646446fb80898b.tar.gz lua-7c3cb71fa48fbe84d9d9c664eb646446fb80898b.tar.bz2 lua-7c3cb71fa48fbe84d9d9c664eb646446fb80898b.zip |
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.
Diffstat (limited to 'ltable.h')
-rw-r--r-- | ltable.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -15,7 +15,12 @@ | |||
15 | #define gnext(n) ((n)->u.next) | 15 | #define gnext(n) ((n)->u.next) |
16 | 16 | ||
17 | 17 | ||
18 | #define invalidateTMcache(t) ((t)->flags = 0) | 18 | /* |
19 | ** Clear all bits of fast-access metamethods, which means that the table | ||
20 | ** may have any of these metamethods. (First access that fails after the | ||
21 | ** clearing will set the bit again.) | ||
22 | */ | ||
23 | #define invalidateTMcache(t) ((t)->flags &= ~maskflags) | ||
19 | 24 | ||
20 | 25 | ||
21 | /* true when 't' is using 'dummynode' as its hash part */ | 26 | /* true when 't' is using 'dummynode' as its hash part */ |