summaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-07-12 15:23:10 +0000
committerAndrew Cagney <cagney@redhat.com>2002-07-12 15:23:10 +0000
commite4e062773b4a9b62871e0ac9834c6c8b570d1977 (patch)
tree34459c4cda1b1cf122299b7c08b1c7c6dd3e9cba /gdb/objfiles.c
parent2fa988ed7f6c346fd403046dc57617a4b1d5fc19 (diff)
downloadgdb-e4e062773b4a9b62871e0ac9834c6c8b570d1977.tar.gz
* bcache.h: Update copyright.
(struct bstring, struct bcache): Move definition to "bcache.c". Replaced by opaque declaration. (bcache_xfree): Replace free_bcache. (bcache_xmalloc, bcache_memory_used): Declare. * bcache.c: Update copyright. (struct bstring, struct bcache): Moved to here from "bcache.h". Update comments. (bcache_xmalloc, bcache_memory_used): New functions. (bcache_xfree): Replace function free_bcache. * Makefile.in (objfiles.o): Add $(bcache_h). (objfiles_h): Remove $(bcache_h). (symfile.o): Add $(bcache_h). * symmisc.c: Update copyright. (print_symbol_bcache_statistics): Pass psymbol_cache by value. (print_objfile_statistics): Use bcache_memory_used. * symfile.c: Include "bcache.h". (reread_symbols): Use bcache_xfree. (reread_symbols): Use bcache_xmalloc and bcache_xfree. (add_psymbol_to_list): Pass psymbol_cache by value. (add_psymbol_with_dem_name_to_list): Ditto. * objfiles.h: Update copyright. (struct bcache): Declare opaque. Do not include "bcache.h". (struct objfile): Change psymbol_cache and macro_cache to ``struct bcache'' pointers. * dwarf2read.c (macro_start_file): Pass macro_cache by value. * objfiles.c: Include "bcache.h". Update copyright. (allocate_objfile): Use bcache_xmalloc to create psymbol_cache and macro_cache. (free_objfile): Use bcache_xfree.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 32bda87b91d..ba55bbb56b7 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1,6 +1,8 @@
/* GDB routines for manipulating objfiles.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
@@ -30,6 +32,7 @@
#include "objfiles.h"
#include "gdb-stabs.h"
#include "target.h"
+#include "bcache.h"
#include <sys/types.h>
#include "gdb_stat.h"
@@ -269,10 +272,8 @@ allocate_objfile (bfd *abfd, int flags)
objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
memset (objfile, 0, sizeof (struct objfile));
objfile->md = NULL;
- obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
- xmalloc, xfree);
- obstack_specify_allocation (&objfile->macro_cache.cache, 0, 0,
- xmalloc, xfree);
+ objfile->psymbol_cache = bcache_xmalloc ();
+ objfile->macro_cache = bcache_xmalloc ();
obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
xfree);
obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
@@ -483,8 +484,8 @@ free_objfile (struct objfile *objfile)
if (objfile->static_psymbols.list)
xmfree (objfile->md, objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles */
- free_bcache (&objfile->psymbol_cache);
- free_bcache (&objfile->macro_cache);
+ bcache_xfree (objfile->psymbol_cache);
+ bcache_xfree (objfile->macro_cache);
obstack_free (&objfile->psymbol_obstack, 0);
obstack_free (&objfile->symbol_obstack, 0);
obstack_free (&objfile->type_obstack, 0);