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.c | |
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.c')
-rw-r--r-- | ltable.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -583,7 +583,7 @@ Table *luaH_new (lua_State *L) { | |||
583 | GCObject *o = luaC_newobj(L, LUA_VTABLE, sizeof(Table)); | 583 | GCObject *o = luaC_newobj(L, LUA_VTABLE, sizeof(Table)); |
584 | Table *t = gco2t(o); | 584 | Table *t = gco2t(o); |
585 | t->metatable = NULL; | 585 | t->metatable = NULL; |
586 | t->flags = cast_byte(~0); | 586 | t->flags = cast_byte(maskflags); /* table has no metamethod fields */ |
587 | t->array = NULL; | 587 | t->array = NULL; |
588 | t->alimit = 0; | 588 | t->alimit = 0; |
589 | setnodevector(L, t, 0); | 589 | setnodevector(L, t, 0); |