diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-05 16:20:51 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-05 16:20:51 -0200 |
| commit | e2498e079e4636217e89f0b28844c4b5df4f8793 (patch) | |
| tree | da82e007f0e8153985323c2bdb190811f79e0c57 /lobject.h | |
| parent | 65726f3e2e226f6a350a5dba643c13c8edd34965 (diff) | |
| download | lua-e2498e079e4636217e89f0b28844c4b5df4f8793.tar.gz lua-e2498e079e4636217e89f0b28844c4b5df4f8793.tar.bz2 lua-e2498e079e4636217e89f0b28844c4b5df4f8793.zip | |
change in hash algorithm so that it does not need empty slot
(tables can be 100% full)
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.7 2004/11/01 15:06:50 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.8 2004/12/04 18:10:22 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 | */ |
| @@ -330,7 +330,7 @@ typedef struct Table { | |||
| 330 | struct Table *metatable; | 330 | struct Table *metatable; |
| 331 | TValue *array; /* array part */ | 331 | TValue *array; /* array part */ |
| 332 | Node *node; | 332 | Node *node; |
| 333 | Node *firstfree; /* this position is free; all positions after it are full */ | 333 | Node *lastfree; /* any free position is before this position */ |
| 334 | GCObject *gclist; | 334 | GCObject *gclist; |
| 335 | int sizearray; /* size of `array' array */ | 335 | int sizearray; /* size of `array' array */ |
| 336 | } Table; | 336 | } Table; |
| @@ -351,6 +351,8 @@ typedef struct Table { | |||
| 351 | 351 | ||
| 352 | extern const TValue luaO_nilobject; | 352 | extern const TValue luaO_nilobject; |
| 353 | 353 | ||
| 354 | #define ceillog2(x) (luaO_log2((x)-1) + 1) | ||
| 355 | |||
| 354 | int luaO_log2 (unsigned int x); | 356 | int luaO_log2 (unsigned int x); |
| 355 | int luaO_int2fb (unsigned int x); | 357 | int luaO_int2fb (unsigned int x); |
| 356 | int luaO_fb2int (int x); | 358 | int luaO_fb2int (int x); |
