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 /ltm.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 'ltm.h')
-rw-r--r-- | ltm.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -46,6 +46,15 @@ typedef enum { | |||
46 | 46 | ||
47 | 47 | ||
48 | /* | 48 | /* |
49 | ** Mask with 1 in all fast-access methods. A 1 in any of these bits | ||
50 | ** in the flag of a (meta)table means the metatable does not have the | ||
51 | ** corresponding metamethod field. (Bit 7 of the flag is used for | ||
52 | ** 'isrealasize'.) | ||
53 | */ | ||
54 | #define maskflags (~(~0u << (TM_EQ + 1))) | ||
55 | |||
56 | |||
57 | /* | ||
49 | ** Test whether there is no tagmethod. | 58 | ** Test whether there is no tagmethod. |
50 | ** (Because tagmethods use raw accesses, the result may be an "empty" nil.) | 59 | ** (Because tagmethods use raw accesses, the result may be an "empty" nil.) |
51 | */ | 60 | */ |