forked from Imagelibrary/binutils-gdb
* symmisc.c (print_symbol_bcache_statistics): Print filename cache
statistics. (print_objfile_statistics): Likewise. * symfile.c (reread_symbols): Initialize filename_cache. (allocate_symtab): Cache the file name. (allocate_psymtab): Likewise. * solib-sunos.c (allocate_rt_common_objfile): Initialize filename_cache. * objfiles.h (struct objfile) <filename_cache>: New field. * objfiles.c (allocate_objfile): Initialize filename_cache. (free_objfile): Free filename_cache.
This commit is contained in:
@@ -199,6 +199,7 @@ allocate_objfile (bfd *abfd, int flags)
|
||||
objfile = (struct objfile *) xzalloc (sizeof (struct objfile));
|
||||
objfile->psymbol_cache = bcache_xmalloc ();
|
||||
objfile->macro_cache = bcache_xmalloc ();
|
||||
objfile->filename_cache = bcache_xmalloc ();
|
||||
/* We could use obstack_specify_allocation here instead, but
|
||||
gdb_obstack.h specifies the alloc/dealloc functions. */
|
||||
obstack_init (&objfile->objfile_obstack);
|
||||
@@ -561,6 +562,7 @@ free_objfile (struct objfile *objfile)
|
||||
/* Free the obstacks for non-reusable objfiles */
|
||||
bcache_xfree (objfile->psymbol_cache);
|
||||
bcache_xfree (objfile->macro_cache);
|
||||
bcache_xfree (objfile->filename_cache);
|
||||
if (objfile->demangled_names_hash)
|
||||
htab_delete (objfile->demangled_names_hash);
|
||||
obstack_free (&objfile->objfile_obstack, 0);
|
||||
|
||||
Reference in New Issue
Block a user