From 4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 14 Oct 1999 17:13:31 -0200 Subject: new implementation of hash tables. --- lobject.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index d69f7c5a..39a51b3d 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.31 1999/10/04 17:51:04 roberto Exp roberto $ +** $Id: lobject.h,v 1.32 1999/10/11 16:13:11 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -162,27 +162,30 @@ typedef struct Closure { typedef struct node { - TObject ref; + TObject key; TObject val; + struct node *next; /* for chaining */ } Node; typedef struct Hash { + int htag; + Node *node; + unsigned int size; + Node *firstfree; /* this position is free; all positions after it are full */ struct Hash *next; int marked; - Node *node; - int nhash; - int nuse; - int htag; } Hash; extern const char *const luaO_typenames[]; + #define luaO_typename(o) luaO_typenames[-ttype(o)] extern const TObject luaO_nilobject; + #define luaO_equalObj(t1,t2) ((ttype(t1) != ttype(t2)) ? 0 \ : luaO_equalval(t1,t2)) int luaO_equalval (const TObject *t1, const TObject *t2); -- cgit v1.2.3-55-g6feb