aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-06-15 11:14:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-06-15 11:14:20 -0300
commit6e600695f8398843a156ce02023f731c6d687ae8 (patch)
treea3e8ef5078e24b5fbdfdfbd89e949bb6c078b90f /lobject.h
parent06127927ffb4eb8459523f6c07bf8f22390c31b9 (diff)
downloadlua-6e600695f8398843a156ce02023f731c6d687ae8.tar.gz
lua-6e600695f8398843a156ce02023f731c6d687ae8.tar.bz2
lua-6e600695f8398843a156ce02023f731c6d687ae8.zip
field 'sizearray' in struct 'Table' changed to 'alimit', which can
be used as a hint for '#t'
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/lobject.h b/lobject.h
index da896662..7c2b3f84 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.143 2018/06/01 16:51:34 roberto Exp roberto $ 2** $Id: lobject.h,v 2.144 2018/06/01 17:40:38 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -669,11 +669,24 @@ typedef union Node {
669 (void)L; checkliveness(L,io_); } 669 (void)L; checkliveness(L,io_); }
670 670
671 671
672/*
673** About 'alimit': if 'isrealasize(t)' is true, then 'alimit' is the
674** real size of 'array'. Otherwise, the real size of 'array' is the
675** smallest power of two not smaller than 'alimit' (or zero iff 'alimit'
676** is zero); 'alimit' is then used as a hint for #t.
677*/
678
679#define BITRAS (1 << 7)
680#define isrealasize(t) (!((t)->marked & BITRAS))
681#define setrealasize(t) ((t)->marked &= cast_byte(~BITRAS))
682#define setnorealasize(t) ((t)->marked |= BITRAS)
683
684
672typedef struct Table { 685typedef struct Table {
673 CommonHeader; 686 CommonHeader;
674 lu_byte flags; /* 1<<p means tagmethod(p) is not present */ 687 lu_byte flags; /* 1<<p means tagmethod(p) is not present */
675 lu_byte lsizenode; /* log2 of size of 'node' array */ 688 lu_byte lsizenode; /* log2 of size of 'node' array */
676 unsigned int sizearray; /* size of 'array' array */ 689 unsigned int alimit; /* "limit" of 'array' array */
677 TValue *array; /* array part */ 690 TValue *array; /* array part */
678 Node *node; 691 Node *node;
679 Node *lastfree; /* any free position is before this position */ 692 Node *lastfree; /* any free position is before this position */