diff options
author | Sami Wagiaalla <swagiaal@redhat.com> | 2010-08-31 17:26:08 +0000 |
---|---|---|
committer | Sami Wagiaalla <swagiaal@redhat.com> | 2010-08-31 17:26:08 +0000 |
commit | cbd705375949178b1929fa12075ee9e8e0da7601 (patch) | |
tree | f56023f6179a960f2a734a015b98e8309e769d35 /gdb/bcache.h | |
parent | 107c6e11a77e8bf6be43c2f68157d90b4634997f (diff) | |
download | gdb-cbd705375949178b1929fa12075ee9e8e0da7601.zip gdb-cbd705375949178b1929fa12075ee9e8e0da7601.tar.gz gdb-cbd705375949178b1929fa12075ee9e8e0da7601.tar.bz2 |
Enable custom bcache hash function.
2010-08-25 Sami Wagiaalla <swagiaal@redhat.com>
* psymtab.c (add_psymbol_to_bcache): Remove 'static' from
'static partial_symbol psymbol'.
(psymbol_hash): New function.
(psymbol_compare): New function.
* bcache.c (hash_continue): New.
(hash): Use hash_continue.
* bcache.c: Add hash_function and compare_function
pointers to bcache struct.
(bcache_full): Use bcache->hash_function, and
bcache->compare_function.
(bcache_compare): New function.
(bcache_xmalloc): Take hash_function and
compare_function arguments and initialize the
bcach's pointers.
Updated comment.
* objfiles.c (allocate_objfile): Updated.
* symfile.c (reread_symbols): Updated.
* python/py-type.c (typy_richcompare): Updated.
Diffstat (limited to 'gdb/bcache.h')
-rw-r--r-- | gdb/bcache.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/bcache.h b/gdb/bcache.h index da69a2d..d000962 100644 --- a/gdb/bcache.h +++ b/gdb/bcache.h @@ -158,7 +158,9 @@ extern const void *bcache_full (const void *addr, int length, extern void bcache_xfree (struct bcache *bcache); /* Create a new bcache object. */ -extern struct bcache *bcache_xmalloc (void); +extern struct bcache *bcache_xmalloc ( + unsigned long (*hash_function)(const void *, int length), + int (*compare_function)(const void *, const void *, int length)); /* Print statistics on BCACHE's memory usage and efficacity at eliminating duplication. TYPE should be a string describing the @@ -167,7 +169,9 @@ extern struct bcache *bcache_xmalloc (void); extern void print_bcache_statistics (struct bcache *bcache, char *type); extern int bcache_memory_used (struct bcache *bcache); -/* The hash function */ +/* The hash functions */ extern unsigned long hash(const void *addr, int length); +extern unsigned long hash_continue (const void *addr, int length, + unsigned long h); #endif /* BCACHE_H */ |