2 * UCW Library -- Universal Hash Table
4 * (c) 2002--2004 Martin Mares <mj@ucw.cz>
5 * (c) 2002--2005 Robert Spalek <robert@ucw.cz>
7 * This software may be freely distributed and used according to the terms
8 * of the GNU Lesser General Public License.
12 * This is not a normal header file, it's a generator of hash tables.
13 * Each time you include it with parameters set in the corresponding
14 * preprocessor macros, it generates a hash table with the parameters
17 * You need to specify:
19 * HASH_NODE data type where a node dwells (usually a struct).
20 * HASH_PREFIX(x) macro to add a name prefix (used on all global names
21 * defined by the hash table generator).
23 * Then decide on type of keys:
25 * HASH_KEY_ATOMIC=f use node->f as a key of an atomic type (i.e.,
26 * a type which can be compared using `==')
27 * HASH_ATOMIC_TYPE (defaults to int).
28 * | HASH_KEY_STRING=f use node->f as a string key, allocated
29 * separately from the rest of the node.
30 * | HASH_KEY_ENDSTRING=f use node->f as a string key, allocated
31 * automatically at the end of the node struct
32 * (to be declared as "char f[1]" at the end).
33 * | HASH_KEY_COMPLEX use a multi-component key; as the name suggests,
34 * the passing of parameters is a bit complex then.
35 * The HASH_KEY_COMPLEX(x) macro should expand to
36 * `x k1, x k2, ... x kn' and you should also define:
37 * HASH_KEY_DECL declaration of function parameters in which key
38 * should be passed to all hash table operations.
39 * That is, `type1 k1, type2 k2, ... typen kn'.
40 * With complex keys, HASH_GIVE_HASHFN and HASH_GIVE_EQ
42 * | HASH_KEY_MEMORY=f use node->f as a raw data key, compared using
44 * HASH_KEY_SIZE the length of the key block
46 * Then specify what operations you request (all names are automatically
47 * prefixed by calling HASH_PREFIX):
49 * <always defined> init() -- initialize the hash table.
50 * HASH_WANT_CLEANUP cleanup() -- deallocate the hash table.
51 * HASH_WANT_FIND node *find(key) -- find first node with the specified
52 * key, return NULL if no such node exists.
53 * HASH_WANT_FIND_NEXT node *find(node *start) -- find next node with the
54 * specified key, return NULL if no such node exists.
55 * HASH_WANT_NEW node *new(key) -- create new node with given key.
56 * Doesn't check whether it already exists.
57 * HASH_WANT_LOOKUP node *lookup(key) -- find node with given key,
58 * if it doesn't exist, create it. Defining
59 * HASH_GIVE_INIT_DATA is strongly recommended.
60 * HASH_WANT_DELETE int delete(key) -- delete and deallocate node
61 * with given key. Returns success.
62 * HASH_WANT_REMOVE remove(node *) -- delete and deallocate given node.
64 * You can also supply several functions:
66 * HASH_GIVE_HASHFN unsigned int hash(key) -- calculate hash value of key.
67 * We have sensible default hash functions for strings
69 * HASH_GIVE_EQ int eq(key1, key2) -- return whether keys are equal.
70 * By default, we use == for atomic types and either
71 * strcmp or strcasecmp for strings.
72 * HASH_GIVE_EXTRA_SIZE int extra_size(key) -- returns how many bytes after the
73 * node should be allocated for dynamic data. Default=0
74 * or length of the string with HASH_KEY_ENDSTRING.
75 * HASH_GIVE_INIT_KEY void init_key(node *,key) -- initialize key in a newly
76 * created node. Defaults: assignment for atomic keys
77 * and static strings, strcpy for end-allocated strings.
78 * HASH_GIVE_INIT_DATA void init_data(node *) -- initialize data fields in a
79 * newly created node. Very useful for lookup operations.
80 * HASH_GIVE_ALLOC void *alloc(unsigned int size) -- allocate space for
81 * a node. Default is xmalloc() or pooled allocation, depending
82 * on HASH_USE_POOL, HASH_AUTO_POOL, HASH_USE_ELTPOOL
83 * and HASH_AUTO_ELTPOOL switches. void free(void *) -- the converse.
84 * HASH_GIVE_TABLE_ALLOC void *table_alloc(unsigned int size), void *table_free(void *)
85 * Allocate or free space for the table itself. Default is xmalloc()
86 * or the functions defined by HASH_GIVE_ALLOC if HASH_TABLE_ALLOC is set.
88 * ... and a couple of extra parameters:
90 * HASH_NOCASE String comparisons should be case-insensitive.
91 * HASH_DEFAULT_SIZE=n Initially, use hash table of approx. `n' entries.
92 * HASH_CONSERVE_SPACE Use as little space as possible.
93 * HASH_FN_BITS=n The hash function gives only `n' significant bits.
94 * HASH_ATOMIC_TYPE=t Atomic values are of type `t' instead of int.
95 * HASH_USE_POOL=pool Allocate all nodes from given mempool. Note, however, that
96 * deallocation is not supported by mempools, so delete/remove
97 * will leak pool memory.
98 * HASH_AUTO_POOL=size Create a pool of the given block size automatically.
99 * HASH_USE_ELTPOOL=pool Allocate all nodes from given eltpool.
100 * Only works for nodes of limited size.
101 * HASH_AUTO_ELTPOOL=count Create an eltpool of the given number of elements in each chunk.
102 * Only works for fixed-sized nodes and zero HASH_GIVE_EXTRA_SIZE.
103 * HASH_ZERO_FILL New entries should be initialized to all zeroes.
104 * HASH_TABLE_ALLOC The hash table itself will be allocated and freed using
105 * the same allocation functions as the nodes instead of
106 * the default xmalloc().
107 * HASH_TABLE_GROW Never decrease the size of the hash table itself
108 * HASH_TABLE_DYNAMIC Support multiple hash tables; the first parameter of all
109 * hash table operations is struct HASH_PREFIX(table) *.
110 * HASH_TABLE_VARS Extra variables to be defined in table structure
112 * You also get a iterator macro at no extra charge:
114 * HASH_FOR_ALL(hash_prefix, variable)
116 * // node *variable gets declared automatically
117 * do_something_with_node(variable);
118 * // use HASH_BREAK and HASH_CONTINUE instead of break and continue
119 * // you must not alter contents of the hash table here
123 * (For dynamic tables, use HASH_FOR_ALL_DYNAMIC(hash_prefix, hash_table, variable) instead.)
125 * Then include "ucw/hashtable.h" and voila, you have a hash table
126 * suiting all your needs (at least those which you've revealed :) ).
128 * After including this file, all parameter macros are automatically
132 #ifndef _UCW_HASHFUNC_H
133 #include "ucw/hashfunc.h"
136 #include "ucw/prime.h"
140 /* Initial setup of parameters */
142 #if !defined(HASH_NODE) || !defined(HASH_PREFIX)
143 #error Some of the mandatory configuration macros are missing.
146 #if defined(HASH_KEY_ATOMIC) && !defined(HASH_CONSERVE_SPACE)
147 #define HASH_CONSERVE_SPACE
150 #define P(x) HASH_PREFIX(x)
152 /* Declare buckets and the hash table */
154 typedef HASH_NODE P(node);
156 typedef struct P(bucket) {
157 struct P(bucket) *next;
158 #ifndef HASH_CONSERVE_SPACE
166 uns hash_count, hash_max, hash_min, hash_hard_max;
168 #ifdef HASH_AUTO_POOL
169 struct mempool *pool;
171 #ifdef HASH_AUTO_ELTPOOL
172 struct eltpool *eltpool;
174 #ifdef HASH_TABLE_VARS
179 #ifdef HASH_TABLE_DYNAMIC
181 #define TA struct P(table) *table
183 #define TAU TA UNUSED
184 #define TAUC TA UNUSED,
188 struct P(table) P(table);
198 /* Preset parameters */
200 #if defined(HASH_KEY_ATOMIC)
202 #define HASH_KEY(x) x HASH_KEY_ATOMIC
204 #ifndef HASH_ATOMIC_TYPE
205 # define HASH_ATOMIC_TYPE int
207 #define HASH_KEY_DECL HASH_ATOMIC_TYPE HASH_KEY( )
209 #ifndef HASH_GIVE_HASHFN
210 # define HASH_GIVE_HASHFN
211 static inline int P(hash) (TAUC HASH_ATOMIC_TYPE x)
212 { return ((sizeof(x) <= 4) ? hash_u32(x) : hash_u64(x)); }
216 # define HASH_GIVE_EQ
217 static inline int P(eq) (TAUC HASH_ATOMIC_TYPE x, HASH_ATOMIC_TYPE y)
221 #ifndef HASH_GIVE_INIT_KEY
222 # define HASH_GIVE_INIT_KEY
223 static inline void P(init_key) (TAUC P(node) *n, HASH_ATOMIC_TYPE k)
224 { HASH_KEY(n->) = k; }
227 #elif defined(HASH_KEY_MEMORY)
229 #define HASH_KEY(x) x HASH_KEY_MEMORY
231 #define HASH_KEY_DECL byte HASH_KEY( )[HASH_KEY_SIZE]
233 #ifndef HASH_GIVE_HASHFN
234 # define HASH_GIVE_HASHFN
235 static inline int P(hash) (TAUC byte *x)
236 { return hash_block(x, HASH_KEY_SIZE); }
240 # define HASH_GIVE_EQ
241 static inline int P(eq) (TAUC byte *x, byte *y)
242 { return !memcmp(x, y, HASH_KEY_SIZE); }
245 #ifndef HASH_GIVE_INIT_KEY
246 # define HASH_GIVE_INIT_KEY
247 static inline void P(init_key) (TAUC P(node) *n, byte *k)
248 { memcpy(HASH_KEY(n->), k, HASH_KEY_SIZE); }
251 #elif defined(HASH_KEY_STRING) || defined(HASH_KEY_ENDSTRING)
253 #ifdef HASH_KEY_STRING
254 # define HASH_KEY(x) x HASH_KEY_STRING
255 # ifndef HASH_GIVE_INIT_KEY
256 # define HASH_GIVE_INIT_KEY
257 static inline void P(init_key) (TAUC P(node) *n, char *k)
258 { HASH_KEY(n->) = k; }
261 # define HASH_KEY(x) x HASH_KEY_ENDSTRING
262 # define HASH_GIVE_EXTRA_SIZE
263 static inline int P(extra_size) (TAUC char *k)
264 { return strlen(k); }
265 # ifndef HASH_GIVE_INIT_KEY
266 # define HASH_GIVE_INIT_KEY
267 static inline void P(init_key) (TAUC P(node) *n, char *k)
268 { strcpy(HASH_KEY(n->), k); }
271 #define HASH_KEY_DECL char *HASH_KEY( )
273 #ifndef HASH_GIVE_HASHFN
274 #define HASH_GIVE_HASHFN
275 static inline uns P(hash) (TAUC char *k)
278 return hash_string_nocase(k);
280 return hash_string(k);
286 # define HASH_GIVE_EQ
287 static inline int P(eq) (TAUC char *x, char *y)
290 return !strcasecmp(x,y);
297 #elif defined(HASH_KEY_COMPLEX)
299 #define HASH_KEY(x) HASH_KEY_COMPLEX(x)
302 #error You forgot to set the hash key type.
305 /* Defaults for missing parameters */
307 #ifndef HASH_GIVE_HASHFN
308 #error Unable to determine which hash function to use.
312 #error Unable to determine how to compare two keys.
315 #ifdef HASH_GIVE_EXTRA_SIZE
316 /* This trickery is needed to avoid `unused parameter' warnings */
317 #define HASH_EXTRA_SIZE(x) P(extra_size)(TTC x)
320 * Beware, C macros are expanded iteratively, not recursively,
321 * hence we get only a _single_ argument, although the expansion
322 * of HASH_KEY contains commas.
324 #define HASH_EXTRA_SIZE(x) 0
327 #ifndef HASH_GIVE_INIT_KEY
328 #error Unable to determine how to initialize keys.
331 #ifndef HASH_GIVE_INIT_DATA
332 static inline void P(init_data) (TAUC P(node) *n UNUSED)
337 #ifdef HASH_GIVE_ALLOC
338 /* If the caller has requested to use his own allocation functions, do so */
339 static inline void P(init_alloc) (TAU) { }
340 static inline void P(cleanup_alloc) (TAU) { }
342 #elif defined(HASH_USE_POOL)
343 /* If the caller has requested to use his mempool, do so */
344 #include "ucw/mempool.h"
345 static inline void * P(alloc) (TAUC unsigned int size) { return mp_alloc_fast(HASH_USE_POOL, size); }
346 static inline void P(free) (TAUC void *x UNUSED) { }
347 static inline void P(init_alloc) (TAU) { }
348 static inline void P(cleanup_alloc) (TAU) { }
350 #elif defined(HASH_AUTO_POOL)
351 /* Use our own pools */
352 #include "ucw/mempool.h"
353 static inline void * P(alloc) (TAUC unsigned int size) { return mp_alloc_fast(T.pool, size); }
354 static inline void P(free) (TAUC void *x UNUSED) { }
355 static inline void P(init_alloc) (TAU) { T.pool = mp_new(HASH_AUTO_POOL); }
356 static inline void P(cleanup_alloc) (TAU) { mp_delete(T.pool); }
357 #define HASH_USE_POOL
359 #elif defined(HASH_USE_ELTPOOL)
360 /* If the caller has requested to use his eltpool, do so */
361 #include "ucw/eltpool.h"
362 static inline void * P(alloc) (TAUC unsigned int size) { ASSERT(size <= (HASH_USE_ELTPOOL)->elt_size); return ep_alloc(HASH_USE_ELTPOOL); }
363 static inline void P(free) (TAUC void *x) { ep_free(HASH_USE_ELTPOOL, x); }
364 static inline void P(init_alloc) (TAU) { }
365 static inline void P(cleanup_alloc) (TAU) { }
367 #elif defined(HASH_AUTO_ELTPOOL)
368 /* Use our own eltpools */
369 #ifdef HASH_GIVE_EXTRA_SIZE
370 #error HASH_AUTO_ELTPOOL not supported in combination with variable-sized nodes
372 #include "ucw/eltpool.h"
373 static inline void * P(alloc) (TAUC unsigned int size UNUSED) { return ep_alloc(T.eltpool); }
374 static inline void P(free) (TAUC void *x) { ep_free(T.eltpool, x); }
375 static inline void P(init_alloc) (TAU) { T.eltpool = ep_new(sizeof(P(bucket)), HASH_AUTO_ELTPOOL); }
376 static inline void P(cleanup_alloc) (TAU) { ep_delete(T.eltpool); }
377 #define HASH_USE_ELTPOOL
380 /* The default allocation method */
381 static inline void * P(alloc) (TAUC unsigned int size) { return xmalloc(size); }
382 static inline void P(free) (TAUC void *x) { xfree(x); }
383 static inline void P(init_alloc) (TAU) { }
384 static inline void P(cleanup_alloc) (TAU) { }
388 #ifdef HASH_GIVE_TABLE_ALLOC
389 /* If the caller has requested to use his own allocation functions, do so */
390 #elif defined(HASH_TABLE_ALLOC)
391 #ifdef HASH_USE_ELTPOOL
392 #error HASH_TABLE_ALLOC not supported in combination with eltpools
394 static inline void * P(table_alloc) (TAUC unsigned int size) { return P(alloc)(TTC size); }
395 static inline void P(table_free) (TAUC void *x) { P(free)(TTC x); }
397 static inline void * P(table_alloc) (TAUC unsigned int size) { return xmalloc(size); }
398 static inline void P(table_free) (TAUC void *x) { xfree(x); }
401 #if defined(HASH_USE_POOL) && defined(HASH_TABLE_ALLOC) && !defined(HASH_TABLE_GROW)
402 #define HASH_TABLE_GROW
405 #ifndef HASH_DEFAULT_SIZE
406 #define HASH_DEFAULT_SIZE 32
410 #define HASH_FN_BITS 32
413 #ifdef HASH_ZERO_FILL
414 static inline void * P(new_bucket)(TAUC uns size)
416 byte *buck = P(alloc)(TTC size);
421 static inline void * P(new_bucket)(TAUC uns size) { return P(alloc)(TTC size); }
424 /* Now the operations */
426 static void P(alloc_table) (TAU)
428 T.hash_size = next_table_prime(T.hash_size);
429 T.ht = P(table_alloc)(TTC sizeof(void *) * T.hash_size);
430 bzero(T.ht, sizeof(void *) * T.hash_size);
431 if (2*T.hash_size < T.hash_hard_max)
432 T.hash_max = 2*T.hash_size;
435 #ifndef HASH_TABLE_GROW
436 if (T.hash_size/2 > HASH_DEFAULT_SIZE)
437 T.hash_min = T.hash_size/4;
444 * Initializes the hash table.
445 * This one is available no matter what `HASH_WANT_` macros you defined or not.
447 static void HASH_PREFIX(init)(TA)
450 T.hash_size = HASH_DEFAULT_SIZE;
451 #if HASH_FN_BITS < 28
452 T.hash_hard_max = 1 << HASH_FN_BITS;
454 T.hash_hard_max = 1 << 28;
460 #ifdef HASH_WANT_CLEANUP
462 * Deallocates the hash table, including the nodes.
463 * It is available if you defined <<want_cleanup,`HASH_WANT_CLEANUP`>>.
465 static void HASH_PREFIX(cleanup)(TA)
467 #ifndef HASH_USE_POOL
471 for (i=0; i<T.hash_size; i++)
472 for (b=T.ht[i]; b; b=bb)
478 P(cleanup_alloc)(TT);
479 P(table_free)(TTC T.ht);
483 static inline uns P(bucket_hash) (TAUC P(bucket) *b)
485 #ifdef HASH_CONSERVE_SPACE
486 return P(hash)(TTC HASH_KEY(b->n.));
492 static void P(rehash) (TAC uns size)
495 P(bucket) **oldt = T.ht, **newt;
496 uns oldsize = T.hash_size;
499 DBG("Rehashing %d->%d at count %d", oldsize, size, T.hash_count);
503 for (i=0; i<oldsize; i++)
509 h = P(bucket_hash)(TTC b) % T.hash_size;
515 P(table_free)(TTC oldt);
518 #ifdef HASH_WANT_FIND
520 * Finds a node with given key (specified in the @HAS_KEY_DECL parameter).
521 * If it does not exist, NULL is returned.
523 * Enabled by the <<want_find,`HASH_WANT_FIND`>> macro.
525 static HASH_NODE* HASH_PREFIX(find)(TAC HASH_KEY_DECL)
527 uns h0 = P(hash) (TTC HASH_KEY( ));
528 uns h = h0 % T.hash_size;
531 for (b=T.ht[h]; b; b=b->next)
534 #ifndef HASH_CONSERVE_SPACE
537 P(eq)(TTC HASH_KEY( ), HASH_KEY(b->n.)))
544 #ifdef HASH_WANT_FIND_NEXT
546 * Finds next node with the same key. Returns NULL if it does not exist.
548 * Enabled by the <<want_find_next,`HASH_WANT_FIND_NEXT`>> macro.
550 static HASH_NODE* HASH_PREFIX(find_next)(TAC P(node) *start)
552 #ifndef HASH_CONSERVE_SPACE
553 uns h0 = P(hash) (TTC HASH_KEY(start->));
555 P(bucket) *b = SKIP_BACK(P(bucket), n, start);
557 for (b=b->next; b; b=b->next)
560 #ifndef HASH_CONSERVE_SPACE
563 P(eq)(TTC HASH_KEY(start->), HASH_KEY(b->n.)))
572 * Generates a new node with a given key.
574 * Enabled by the <<want_new,`HASH_WANT_NEW`>> macro.
576 static HASH_NODE * HASH_PREFIX(new)(TAC HASH_KEY_DECL)
581 h0 = P(hash) (TTC HASH_KEY( ));
582 h = h0 % T.hash_size;
583 b = P(new_bucket) (TTC sizeof(struct P(bucket)) + HASH_EXTRA_SIZE(HASH_KEY( )));
586 #ifndef HASH_CONSERVE_SPACE
589 P(init_key)(TTC &b->n, HASH_KEY( ));
590 P(init_data)(TTC &b->n);
591 if (T.hash_count++ >= T.hash_max)
592 P(rehash)(TTC 2*T.hash_size);
597 #ifdef HASH_WANT_LOOKUP
599 * Finds a node with a given key. If it does not exist, a new one is created.
600 * It is strongly recommended to use <<give_init_data,`HASH_GIVE_INIT_DATA`>>.
602 * This one is enabled by the <<want_lookup,`HASH_WANT_LOOKUP`>> macro.
604 static HASH_NODE* HASH_PREFIX(lookup)(TAC HASH_KEY_DECL)
606 uns h0 = P(hash) (TTC HASH_KEY( ));
607 uns h = h0 % T.hash_size;
610 for (b=T.ht[h]; b; b=b->next)
613 #ifndef HASH_CONSERVE_SPACE
616 P(eq)(TTC HASH_KEY( ), HASH_KEY(b->n.)))
620 b = P(new_bucket) (TTC sizeof(struct P(bucket)) + HASH_EXTRA_SIZE(HASH_KEY( )));
623 #ifndef HASH_CONSERVE_SPACE
626 P(init_key)(TTC &b->n, HASH_KEY( ));
627 P(init_data)(TTC &b->n);
628 if (T.hash_count++ >= T.hash_max)
629 P(rehash)(TTC 2*T.hash_size);
634 #ifdef HASH_WANT_DELETE
636 * Removes a node with the given key from hash table and deallocates it.
638 * Success is returned.
640 * This one is enabled by <<want_delete,`HASH_WANT_DELETE`>> macro.
642 static int HASH_PREFIX(delete)(TAC HASH_KEY_DECL)
644 uns h0 = P(hash) (TTC HASH_KEY( ));
645 uns h = h0 % T.hash_size;
648 for (bb=&T.ht[h]; b=*bb; bb=&b->next)
651 #ifndef HASH_CONSERVE_SPACE
654 P(eq)(TTC HASH_KEY( ), HASH_KEY(b->n.)))
658 #ifndef HASH_TABLE_GROW
659 if (--T.hash_count < T.hash_min)
660 P(rehash)(TTC T.hash_size/2);
669 #ifdef HASH_WANT_REMOVE
671 * Removes a given node and deallocates it.
672 * It differs from <<fun__GENERIC_LINK|HASH_PREFIX|delete,`HASH_PREFIX(delete)()`>>
673 * in its type of parameter -- this one deletes a specific node, that one looks for it by a key.
675 * Enabled by <<want_remove,`HASH_WANT_REMOVE`>> macro.
677 static void HASH_PREFIX(remove)(TAC HASH_NODE *n)
679 P(bucket) *x = SKIP_BACK(struct P(bucket), n, n);
680 uns h0 = P(bucket_hash)(TTC x);
681 uns h = h0 % T.hash_size;
684 for (bb=&T.ht[h]; (b=*bb) && b != x; bb=&b->next)
689 #ifndef HASH_TABLE_GROW
690 if (--T.hash_count < T.hash_min)
691 P(rehash)(TTC T.hash_size/2);
696 /* And the iterator */
700 #define HASH_FOR_ALL_DYNAMIC(h_px, h_table, h_var) \
703 struct GLUE_(h_px,bucket) *h_buck; \
704 for (h_slot=0; h_slot < (h_table)->hash_size; h_slot++) \
705 for (h_buck = (h_table)->ht[h_slot]; h_buck; h_buck = h_buck->next) \
707 GLUE_(h_px,node) *h_var = &h_buck->n;
708 #define HASH_FOR_ALL(h_px, h_var) HASH_FOR_ALL_DYNAMIC(h_px, &GLUE_(h_px,table), h_var)
709 #define HASH_END_FOR } } while(0)
711 #define HASH_CONTINUE continue
715 /* Finally, undefine all the parameters */
726 #undef HASH_ATOMIC_TYPE
727 #undef HASH_CONSERVE_SPACE
728 #undef HASH_DEFAULT_SIZE
729 #undef HASH_EXTRA_SIZE
731 #undef HASH_GIVE_ALLOC
732 #undef HASH_GIVE_TABLE_ALLOC
734 #undef HASH_GIVE_EXTRA_SIZE
735 #undef HASH_GIVE_HASHFN
736 #undef HASH_GIVE_INIT_DATA
737 #undef HASH_GIVE_INIT_KEY
739 #undef HASH_KEY_ATOMIC
740 #undef HASH_KEY_COMPLEX
742 #undef HASH_KEY_ENDSTRING
743 #undef HASH_KEY_STRING
744 #undef HASH_KEY_MEMORY
750 #undef HASH_AUTO_POOL
751 #undef HASH_USE_ELTPOOL
752 #undef HASH_AUTO_ELTPOOL
753 #undef HASH_WANT_CLEANUP
754 #undef HASH_WANT_DELETE
755 #undef HASH_WANT_FIND
756 #undef HASH_WANT_FIND_NEXT
757 #undef HASH_WANT_LOOKUP
759 #undef HASH_WANT_REMOVE
760 #undef HASH_TABLE_ALLOC
761 #undef HASH_TABLE_GROW
762 #undef HASH_TABLE_DYNAMIC
763 #undef HASH_TABLE_VARS
764 #undef HASH_ZERO_FILL