summaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-10-06 15:34:16 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-10-06 15:34:16 -0300
commitbd38017ddfeda738f3f1881043c0ec8bbea1adbc (patch)
tree4fd935dbf16599661abc2d0c6be8ca8be083b678 /lobject.h
parent652f885c30e36c3bdbecd71b70dfbf273abfe24e (diff)
downloadlua-bd38017ddfeda738f3f1881043c0ec8bbea1adbc.tar.gz
lua-bd38017ddfeda738f3f1881043c0ec8bbea1adbc.tar.bz2
lua-bd38017ddfeda738f3f1881043c0ec8bbea1adbc.zip
small optimization for table size in machines with double allignment
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/lobject.h b/lobject.h
index ada627fd..b407a196 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.4 2004/03/15 21:04:33 roberto Exp roberto $ 2** $Id: lobject.h,v 2.5 2004/05/31 18:51:50 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*/
@@ -64,9 +64,11 @@ typedef union {
64/* 64/*
65** Tagged Values 65** Tagged Values
66*/ 66*/
67
68#define TValuefields Value value; int tt
69
67typedef struct lua_TValue { 70typedef struct lua_TValue {
68 int tt; 71 TValuefields;
69 Value value;
70} TValue; 72} TValue;
71 73
72 74
@@ -158,7 +160,7 @@ typedef struct lua_TValue {
158 160
159#define setobj(L,obj1,obj2) \ 161#define setobj(L,obj1,obj2) \
160 { const TValue *o2=(obj2); TValue *o1=(obj1); \ 162 { const TValue *o2=(obj2); TValue *o1=(obj1); \
161 o1->tt=o2->tt; o1->value = o2->value; \ 163 o1->value = o2->value; o1->tt=o2->tt; \
162 checkliveness(G(L),o1); } 164 checkliveness(G(L),o1); }
163 165
164 166
@@ -308,10 +310,15 @@ typedef union Closure {
308** Tables 310** Tables
309*/ 311*/
310 312
313typedef struct TKey {
314 TValuefields;
315 struct Node *next; /* for chaining */
316} TKey;
317
318
311typedef struct Node { 319typedef struct Node {
312 TValue i_key;
313 TValue i_val; 320 TValue i_val;
314 struct Node *next; /* for chaining */ 321 TKey i_key;
315} Node; 322} Node;
316 323
317 324