From e2498e079e4636217e89f0b28844c4b5df4f8793 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 5 Jan 2005 16:20:51 -0200 Subject: change in hash algorithm so that it does not need empty slot (tables can be 100% full) --- lobject.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 259bdac5..2c0a5d26 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.7 2004/11/01 15:06:50 roberto Exp roberto $ +** $Id: lobject.h,v 2.8 2004/12/04 18:10:22 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -330,7 +330,7 @@ typedef struct Table { struct Table *metatable; TValue *array; /* array part */ Node *node; - Node *firstfree; /* this position is free; all positions after it are full */ + Node *lastfree; /* any free position is before this position */ GCObject *gclist; int sizearray; /* size of `array' array */ } Table; @@ -351,6 +351,8 @@ typedef struct Table { extern const TValue luaO_nilobject; +#define ceillog2(x) (luaO_log2((x)-1) + 1) + int luaO_log2 (unsigned int x); int luaO_int2fb (unsigned int x); int luaO_fb2int (int x); -- cgit v1.2.3-55-g6feb