diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-10-14 17:13:31 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-10-14 17:13:31 -0200 |
commit | 4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec (patch) | |
tree | d11eee681ce7b01a273e489f47e070494b51de1a /lobject.h | |
parent | b6ebbb2fee13aa223fdd12921cd0411e02db9dd0 (diff) | |
download | lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.gz lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.bz2 lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.zip |
new implementation of hash tables.
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 1.31 1999/10/04 17:51:04 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.32 1999/10/11 16:13:11 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 | */ |
@@ -162,27 +162,30 @@ typedef struct Closure { | |||
162 | 162 | ||
163 | 163 | ||
164 | typedef struct node { | 164 | typedef struct node { |
165 | TObject ref; | 165 | TObject key; |
166 | TObject val; | 166 | TObject val; |
167 | struct node *next; /* for chaining */ | ||
167 | } Node; | 168 | } Node; |
168 | 169 | ||
169 | typedef struct Hash { | 170 | typedef struct Hash { |
171 | int htag; | ||
172 | Node *node; | ||
173 | unsigned int size; | ||
174 | Node *firstfree; /* this position is free; all positions after it are full */ | ||
170 | struct Hash *next; | 175 | struct Hash *next; |
171 | int marked; | 176 | int marked; |
172 | Node *node; | ||
173 | int nhash; | ||
174 | int nuse; | ||
175 | int htag; | ||
176 | } Hash; | 177 | } Hash; |
177 | 178 | ||
178 | 179 | ||
179 | extern const char *const luaO_typenames[]; | 180 | extern const char *const luaO_typenames[]; |
180 | 181 | ||
182 | |||
181 | #define luaO_typename(o) luaO_typenames[-ttype(o)] | 183 | #define luaO_typename(o) luaO_typenames[-ttype(o)] |
182 | 184 | ||
183 | 185 | ||
184 | extern const TObject luaO_nilobject; | 186 | extern const TObject luaO_nilobject; |
185 | 187 | ||
188 | |||
186 | #define luaO_equalObj(t1,t2) ((ttype(t1) != ttype(t2)) ? 0 \ | 189 | #define luaO_equalObj(t1,t2) ((ttype(t1) != ttype(t2)) ? 0 \ |
187 | : luaO_equalval(t1,t2)) | 190 | : luaO_equalval(t1,t2)) |
188 | int luaO_equalval (const TObject *t1, const TObject *t2); | 191 | int luaO_equalval (const TObject *t1, const TObject *t2); |