From 6e600695f8398843a156ce02023f731c6d687ae8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 15 Jun 2018 11:14:20 -0300 Subject: field 'sizearray' in struct 'Table' changed to 'alimit', which can be used as a hint for '#t' --- lobject.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index da896662..7c2b3f84 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.143 2018/06/01 16:51:34 roberto Exp roberto $ +** $Id: lobject.h,v 2.144 2018/06/01 17:40:38 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -669,11 +669,24 @@ typedef union Node { (void)L; checkliveness(L,io_); } +/* +** About 'alimit': if 'isrealasize(t)' is true, then 'alimit' is the +** real size of 'array'. Otherwise, the real size of 'array' is the +** smallest power of two not smaller than 'alimit' (or zero iff 'alimit' +** is zero); 'alimit' is then used as a hint for #t. +*/ + +#define BITRAS (1 << 7) +#define isrealasize(t) (!((t)->marked & BITRAS)) +#define setrealasize(t) ((t)->marked &= cast_byte(~BITRAS)) +#define setnorealasize(t) ((t)->marked |= BITRAS) + + typedef struct Table { CommonHeader; lu_byte flags; /* 1<