diff options
author | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-08-09 08:24:45 -0300 |
---|---|---|
committer | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-08-09 08:24:45 -0300 |
commit | b28da81cfe371f602474f75c0c4f706772eed92a (patch) | |
tree | 545597f252950306763dea54cd371851d2a11b1d /hash.h | |
parent | 41fd23287aae60354c264be8f1807bccd937fbf1 (diff) | |
download | lua-b28da81cfe371f602474f75c0c4f706772eed92a.tar.gz lua-b28da81cfe371f602474f75c0c4f706772eed92a.tar.bz2 lua-b28da81cfe371f602474f75c0c4f706772eed92a.zip |
Alteracao do hash, trocando tratamento de colisao por lista
pela estrategia de re-hash.
Foi feito uma avaliacao da funcao de hash, e constatado sua
eficiencia com uma media de 4 acessos no hash ate' 70% ocupado.
Diffstat (limited to 'hash.h')
-rw-r--r-- | hash.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2,7 +2,7 @@ | |||
2 | ** hash.h | 2 | ** hash.h |
3 | ** hash manager for lua | 3 | ** hash manager for lua |
4 | ** Luiz Henrique de Figueiredo - 17 Aug 90 | 4 | ** Luiz Henrique de Figueiredo - 17 Aug 90 |
5 | ** $Id: hash.h,v 2.1 1994/04/20 22:07:57 celes Exp celes $ | 5 | ** $Id: hash.h,v 2.2 1994/08/05 19:25:09 celes Exp celes $ |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef hash_h | 8 | #ifndef hash_h |
@@ -12,14 +12,14 @@ typedef struct node | |||
12 | { | 12 | { |
13 | Object ref; | 13 | Object ref; |
14 | Object val; | 14 | Object val; |
15 | struct node *next; | ||
16 | } Node; | 15 | } Node; |
17 | 16 | ||
18 | typedef struct Hash | 17 | typedef struct Hash |
19 | { | 18 | { |
20 | char mark; | 19 | char mark; |
21 | unsigned int nhash; | 20 | unsigned int nhash; |
22 | Node **list; | 21 | unsigned int nuse; |
22 | Node *node; | ||
23 | } Hash; | 23 | } Hash; |
24 | 24 | ||
25 | 25 | ||