From 710e1a31c41cfebe0c425d54efa309bb7054cbc2 Mon Sep 17 00:00:00 2001 From: Sami Wagiaalla Date: Tue, 31 Aug 2010 20:10:42 +0000 Subject: Create and use a specialized bcache type for psymbols 2010-08-31 Sami Wagiaalla * symfile.c (reread_symbols): Use psymbol_bcache_free, and psymbol_bcache_init. * psymtab.h (psymbol_bcache_init): New function prototype. (psymbol_bcache_free): New function prototype. (psymbol_bcache_get_bcache): New function prototype. * psymtab.c (psymbol_bcache_init): New function. (psymbol_bcache_free): New function. (psymbol_bcache_full): New function. (psymbol_bcache_get_bcache): New function. (add_psymbol_to_bcache): use psymbol_bcache_full. * objfiles.h (psymbol_cache): Change type of psymbol_cache to psymbol_bcache. * symmisc.c (print_symbol_bcache_statistics): Updated. (print_objfile_statistics): Updated. * objfiles.c (allocate_objfile): Use psymbol_bcache_init to initialize psymbol_cache. (free_objfile): Use psymbol_bcache_free. --- gdb/symfile.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gdb/symfile.c') diff --git a/gdb/symfile.c b/gdb/symfile.c index 048b8a8..087cd3a 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2431,9 +2431,8 @@ reread_symbols (void) sizeof (objfile->static_psymbols)); /* Free the obstacks for non-reusable objfiles */ - bcache_xfree (objfile->psymbol_cache); - objfile->psymbol_cache = bcache_xmalloc (psymbol_hash, - psymbol_compare); + psymbol_bcache_free (objfile->psymbol_cache); + objfile->psymbol_cache = psymbol_bcache_init (); bcache_xfree (objfile->macro_cache); objfile->macro_cache = bcache_xmalloc (NULL, NULL); bcache_xfree (objfile->filename_cache); @@ -2459,8 +2458,7 @@ reread_symbols (void) memset (&objfile->msymbol_demangled_hash, 0, sizeof (objfile->msymbol_demangled_hash)); - objfile->psymbol_cache = bcache_xmalloc (psymbol_hash, - psymbol_compare); + objfile->psymbol_cache = psymbol_bcache_init (); objfile->macro_cache = bcache_xmalloc (NULL, NULL); objfile->filename_cache = bcache_xmalloc (NULL, NULL); /* obstack_init also initializes the obstack so it is -- cgit v1.1