diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-10-06 15:34:16 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-10-06 15:34:16 -0300 |
commit | bd38017ddfeda738f3f1881043c0ec8bbea1adbc (patch) | |
tree | 4fd935dbf16599661abc2d0c6be8ca8be083b678 /lobject.h | |
parent | 652f885c30e36c3bdbecd71b70dfbf273abfe24e (diff) | |
download | lua-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.h | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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 | |||
67 | typedef struct lua_TValue { | 70 | typedef 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 | ||
313 | typedef struct TKey { | ||
314 | TValuefields; | ||
315 | struct Node *next; /* for chaining */ | ||
316 | } TKey; | ||
317 | |||
318 | |||
311 | typedef struct Node { | 319 | typedef 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 | ||