aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-14 17:13:31 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-14 17:13:31 -0200
commit4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec (patch)
treed11eee681ce7b01a273e489f47e070494b51de1a /lobject.h
parentb6ebbb2fee13aa223fdd12921cd0411e02db9dd0 (diff)
downloadlua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.gz
lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.tar.bz2
lua-4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec.zip
new implementation of hash tables.
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/lobject.h b/lobject.h
index d69f7c5a..39a51b3d 100644
--- a/lobject.h
+++ b/lobject.h
@@ -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
164typedef struct node { 164typedef 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
169typedef struct Hash { 170typedef 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
179extern const char *const luaO_typenames[]; 180extern 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
184extern const TObject luaO_nilobject; 186extern 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))
188int luaO_equalval (const TObject *t1, const TObject *t2); 191int luaO_equalval (const TObject *t1, const TObject *t2);