aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-26 16:59:20 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-26 16:59:20 -0200
commitd015f1fc02e03864b0ed3ad668a6e0660417a718 (patch)
tree00b5962e40540bbb8a71bf8665fed256182aa6c7 /lobject.h
parent790690a2236ab0ad0cce35551c17e62064b4c85b (diff)
downloadlua-d015f1fc02e03864b0ed3ad668a6e0660417a718.tar.gz
lua-d015f1fc02e03864b0ed3ad668a6e0660417a718.tar.bz2
lua-d015f1fc02e03864b0ed3ad668a6e0660417a718.zip
table sizes don't need to be primes; power of 2 gives the same performance.
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lobject.h b/lobject.h
index ea397620..d286095f 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.36 1999/11/10 15:39:35 roberto Exp roberto $ 2** $Id: lobject.h,v 1.37 1999/11/22 13:12:07 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*/
@@ -45,7 +45,8 @@ typedef unsigned char Byte; /* unsigned 8 bits */
45 45
46 46
47/* convertion of pointer to int (for hashing only) */ 47/* convertion of pointer to int (for hashing only) */
48#define IntPoint(L, p) ((unsigned int)(p)) 48/* (the shift removes bits that are usually 0 because of alignment) */
49#define IntPoint(L, p) (((unsigned int)(p)) >> 3)
49 50
50 51
51/* 52/*
@@ -194,9 +195,11 @@ typedef struct Hash {
194 195
195extern const char *const luaO_typenames[]; 196extern const char *const luaO_typenames[];
196 197
197
198#define luaO_typename(L, o) luaO_typenames[-ttype(o)] 198#define luaO_typename(L, o) luaO_typenames[-ttype(o)]
199 199
200#define MINPOWER2 4 /* minimum size for "growing" vectors */
201
202unsigned long luaO_power2 (unsigned long n);
200 203
201extern const TObject luaO_nilobject; 204extern const TObject luaO_nilobject;
202 205