aboutsummaryrefslogtreecommitdiff
path: root/ltable.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 /ltable.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 'ltable.h')
-rw-r--r--ltable.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/ltable.h b/ltable.h
index ebd7f8ec..c0060f4b 100644
--- a/ltable.h
+++ b/ltable.h
@@ -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 */