9 typedef struct PLHashAllocOps {
10 void *(PR_CALLBACK *allocTable)(void *pool, PRSize size);
11 void (PR_CALLBACK *freeTable)(void *pool, void *item);
12 PLHashEntry *(PR_CALLBACK *allocEntry)(void *pool, const void *key);
13 void (PR_CALLBACK *freeEntry)(void *pool, PLHashEntry *he, PRUintn flag);
16 #define HT_FREE_VALUE 0 /* just free the entry's value */
17 #define HT_FREE_ENTRY 1 /* free value and entire entry */
23 Users of the hash table functions can provide their own memory
24 allocation functions. A pair of functions is used to allocate and tree
25 the table, and another pair of functions is used to allocate and free
28 The first argument, pool, for all four functions is a void \* pointer
29 that is a piece of data for the memory allocator. Typically pool points
30 to a memory pool used by the memory allocator.
32 The ``freeEntry`` function does not need to free the value of the entry.
33 If flag is ``HT_FREE_ENTRY``, the function frees the entry.
39 The ``key`` argument for the ``allocEntry`` function does not seem to be
40 useful. It is unused in the default ``allocEntry`` function.