aboutsummaryrefslogtreecommitdiff
path: root/ltm.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-08-07 11:21:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-08-07 11:21:44 -0300
commit7c3cb71fa48fbe84d9d9c664eb646446fb80898b (patch)
tree43d2b2282853b882877e42a0b8ec7467c9bb0e9e /ltm.h
parent68109afcdb59a7eeb75bacf055abce3e56a53645 (diff)
downloadlua-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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ltm.h b/ltm.h
index 99b545e7..73b833c6 100644
--- a/ltm.h
+++ b/ltm.h
@@ -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*/