From bd38017ddfeda738f3f1881043c0ec8bbea1adbc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 6 Oct 2004 15:34:16 -0300 Subject: small optimization for table size in machines with double allignment --- lobject.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index ada627fd..b407a196 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.4 2004/03/15 21:04:33 roberto Exp roberto $ +** $Id: lobject.h,v 2.5 2004/05/31 18:51:50 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -64,9 +64,11 @@ typedef union { /* ** Tagged Values */ + +#define TValuefields Value value; int tt + typedef struct lua_TValue { - int tt; - Value value; + TValuefields; } TValue; @@ -158,7 +160,7 @@ typedef struct lua_TValue { #define setobj(L,obj1,obj2) \ { const TValue *o2=(obj2); TValue *o1=(obj1); \ - o1->tt=o2->tt; o1->value = o2->value; \ + o1->value = o2->value; o1->tt=o2->tt; \ checkliveness(G(L),o1); } @@ -308,10 +310,15 @@ typedef union Closure { ** Tables */ +typedef struct TKey { + TValuefields; + struct Node *next; /* for chaining */ +} TKey; + + typedef struct Node { - TValue i_key; TValue i_val; - struct Node *next; /* for chaining */ + TKey i_key; } Node; -- cgit v1.2.3-55-g6feb