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 /lobject.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 'lobject.h')
| -rw-r--r-- | lobject.h | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -704,9 +704,9 @@ typedef union Node { | |||
| 704 | */ | 704 | */ |
| 705 | 705 | ||
| 706 | #define BITRAS (1 << 7) | 706 | #define BITRAS (1 << 7) |
| 707 | #define isrealasize(t) (!((t)->marked & BITRAS)) | 707 | #define isrealasize(t) (!((t)->flags & BITRAS)) |
| 708 | #define setrealasize(t) ((t)->marked &= cast_byte(~BITRAS)) | 708 | #define setrealasize(t) ((t)->flags &= cast_byte(~BITRAS)) |
| 709 | #define setnorealasize(t) ((t)->marked |= BITRAS) | 709 | #define setnorealasize(t) ((t)->flags |= BITRAS) |
| 710 | 710 | ||
| 711 | 711 | ||
| 712 | typedef struct Table { | 712 | typedef struct Table { |
