mfree() -> xmfree().

This commit is contained in:
Andrew Cagney 2001-12-02 22:38:23 +00:00
parent 4c17829508
commit aac7f4eaf2
14 changed files with 48 additions and 44 deletions

View File

@ -1,5 +1,9 @@
2001-12-02 Andrew Cagney <ac131313@redhat.com>
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c, hpread.c,
nlmread.c, objfiles.c, os9kread.c, somread.c, source.c, symfile.c,
symmisc.c, xcoffread.c: Use xmfree instead of mfree.
* jv-lang.c (add_class_symtab_symbol): Use xmrealloc instead of
mrealloc.

View File

@ -713,7 +713,7 @@ coff_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_private != NULL)
{
mfree (objfile->md, objfile->sym_private);
xmfree (objfile->md, objfile->sym_private);
}
/* Let stabs reader clean up */

View File

@ -788,7 +788,7 @@ dbx_symfile_finish (struct objfile *objfile)
}
xfree (hfiles);
}
mfree (objfile->md, objfile->sym_stab_info);
xmfree (objfile->md, objfile->sym_stab_info);
}
free_header_files ();
}
@ -1051,7 +1051,7 @@ find_corresponding_bincl_psymtab (char *name, int instance)
static void
free_bincl_list (struct objfile *objfile)
{
mfree (objfile->md, (PTR) bincl_list);
xmfree (objfile->md, (PTR) bincl_list);
bincls_allocated = 0;
}

View File

@ -678,7 +678,7 @@ free_elfinfo (PTR objp)
while (ssi)
{
nssi = ssi->next;
mfree (objfile->md, ssi);
xmfree (objfile->md, ssi);
ssi = nssi;
}
@ -709,7 +709,7 @@ elf_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_stab_info != NULL)
{
mfree (objfile->md, objfile->sym_stab_info);
xmfree (objfile->md, objfile->sym_stab_info);
}
}

View File

@ -2073,7 +2073,7 @@ hpread_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_private != NULL)
{
mfree (objfile->md, objfile->sym_private);
xmfree (objfile->md, objfile->sym_private);
}
}

View File

@ -625,7 +625,7 @@ hpread_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_private != NULL)
{
mfree (objfile->md, objfile->sym_private);
xmfree (objfile->md, objfile->sym_private);
}
}

View File

@ -224,7 +224,7 @@ nlm_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_private != NULL)
{
mfree (objfile->md, objfile->sym_private);
xmfree (objfile->md, objfile->sym_private);
}
}

View File

@ -187,13 +187,13 @@ allocate_objfile (bfd *abfd, int flags)
objfile->mmfd = fd;
/* Update pointers to functions to *our* copies */
obstack_chunkfun (&objfile->psymbol_cache.cache, xmmalloc);
obstack_freefun (&objfile->psymbol_cache.cache, mfree);
obstack_freefun (&objfile->psymbol_cache.cache, xmfree);
obstack_chunkfun (&objfile->psymbol_obstack, xmmalloc);
obstack_freefun (&objfile->psymbol_obstack, mfree);
obstack_freefun (&objfile->psymbol_obstack, xmfree);
obstack_chunkfun (&objfile->symbol_obstack, xmmalloc);
obstack_freefun (&objfile->symbol_obstack, mfree);
obstack_freefun (&objfile->symbol_obstack, xmfree);
obstack_chunkfun (&objfile->type_obstack, xmmalloc);
obstack_freefun (&objfile->type_obstack, mfree);
obstack_freefun (&objfile->type_obstack, xmfree);
/* If already in objfile list, unlink it. */
unlink_objfile (objfile);
/* Forget things specific to a particular gdb, may have changed. */
@ -216,16 +216,16 @@ allocate_objfile (bfd *abfd, int flags)
objfile->flags |= OBJF_MAPPED;
mmalloc_setkey (objfile->md, 0, objfile);
obstack_specify_allocation_with_arg (&objfile->psymbol_cache.cache,
0, 0, xmmalloc, mfree,
0, 0, xmmalloc, xmfree,
objfile->md);
obstack_specify_allocation_with_arg (&objfile->psymbol_obstack,
0, 0, xmmalloc, mfree,
0, 0, xmmalloc, xmfree,
objfile->md);
obstack_specify_allocation_with_arg (&objfile->symbol_obstack,
0, 0, xmmalloc, mfree,
0, 0, xmmalloc, xmfree,
objfile->md);
obstack_specify_allocation_with_arg (&objfile->type_obstack,
0, 0, xmmalloc, mfree,
0, 0, xmmalloc, xmfree,
objfile->md);
}
}
@ -280,7 +280,7 @@ allocate_objfile (bfd *abfd, int flags)
objfile->obfd = abfd;
if (objfile->name != NULL)
{
mfree (objfile->md, objfile->name);
xmfree (objfile->md, objfile->name);
}
if (abfd != NULL)
{
@ -440,9 +440,9 @@ free_objfile (struct objfile *objfile)
clear_pc_function_cache ();
/* The last thing we do is free the objfile struct itself for the
non-reusable case, or detach from the mapped file for the reusable
case. Note that the mmalloc_detach or the mfree is the last thing
we can do with this objfile. */
non-reusable case, or detach from the mapped file for the
reusable case. Note that the mmalloc_detach or the xmfree() is
the last thing we can do with this objfile. */
#if defined(USE_MMALLOC) && defined(HAVE_MMAP)
@ -467,18 +467,18 @@ free_objfile (struct objfile *objfile)
{
if (objfile->name != NULL)
{
mfree (objfile->md, objfile->name);
xmfree (objfile->md, objfile->name);
}
if (objfile->global_psymbols.list)
mfree (objfile->md, objfile->global_psymbols.list);
xmfree (objfile->md, objfile->global_psymbols.list);
if (objfile->static_psymbols.list)
mfree (objfile->md, objfile->static_psymbols.list);
xmfree (objfile->md, objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles */
free_bcache (&objfile->psymbol_cache);
obstack_free (&objfile->psymbol_obstack, 0);
obstack_free (&objfile->symbol_obstack, 0);
obstack_free (&objfile->type_obstack, 0);
mfree (objfile->md, objfile);
xmfree (objfile->md, objfile);
objfile = NULL;
}
}

View File

@ -415,7 +415,7 @@ os9k_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_stab_info != NULL)
{
mfree (objfile->md, objfile->sym_stab_info);
xmfree (objfile->md, objfile->sym_stab_info);
}
/*
free_header_files ();

View File

@ -423,7 +423,7 @@ som_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_stab_info != NULL)
{
mfree (objfile->md, objfile->sym_stab_info);
xmfree (objfile->md, objfile->sym_stab_info);
}
hpread_symfile_finish (objfile);
}

View File

@ -241,12 +241,12 @@ forget_cached_source_info (void)
{
if (s->line_charpos != NULL)
{
mfree (objfile->md, s->line_charpos);
xmfree (objfile->md, s->line_charpos);
s->line_charpos = NULL;
}
if (s->fullname != NULL)
{
mfree (objfile->md, s->fullname);
xmfree (objfile->md, s->fullname);
s->fullname = NULL;
}
}
@ -682,7 +682,7 @@ open_source_file (struct symtab *s)
if (result >= 0)
return result;
/* Didn't work -- free old one, try again. */
mfree (s->objfile->md, s->fullname);
xmfree (s->objfile->md, s->fullname);
s->fullname = NULL;
}

View File

@ -1667,11 +1667,11 @@ reread_symbols (void)
/* FIXME: Do we have to free a whole linked list, or is this
enough? */
if (objfile->global_psymbols.list)
mfree (objfile->md, objfile->global_psymbols.list);
xmfree (objfile->md, objfile->global_psymbols.list);
memset (&objfile->global_psymbols, 0,
sizeof (objfile->global_psymbols));
if (objfile->static_psymbols.list)
mfree (objfile->md, objfile->static_psymbols.list);
xmfree (objfile->md, objfile->static_psymbols.list);
memset (&objfile->static_psymbols, 0,
sizeof (objfile->static_psymbols));
@ -2417,11 +2417,11 @@ init_psymbol_list (struct objfile *objfile, int total_symbols)
if (objfile->global_psymbols.list)
{
mfree (objfile->md, (PTR) objfile->global_psymbols.list);
xmfree (objfile->md, (PTR) objfile->global_psymbols.list);
}
if (objfile->static_psymbols.list)
{
mfree (objfile->md, (PTR) objfile->static_psymbols.list);
xmfree (objfile->md, (PTR) objfile->static_psymbols.list);
}
/* Current best guess is that approximately a twentieth

View File

@ -89,10 +89,10 @@ free_symtab_block (struct objfile *objfile, struct block *b)
n = BLOCK_NSYMS (b);
for (i = 0; i < n; i++)
{
mfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
mfree (objfile->md, (PTR) BLOCK_SYM (b, i));
xmfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
xmfree (objfile->md, (PTR) BLOCK_SYM (b, i));
}
mfree (objfile->md, (PTR) b);
xmfree (objfile->md, (PTR) b);
}
/* Free all the storage associated with the struct symtab <- S.
@ -126,7 +126,7 @@ free_symtab (register struct symtab *s)
for (i = 0; i < n; i++)
free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i));
/* Free the blockvector itself. */
mfree (s->objfile->md, (PTR) bv);
xmfree (s->objfile->md, (PTR) bv);
/* Also free the linetable. */
case free_linetable:
@ -134,22 +134,22 @@ free_symtab (register struct symtab *s)
or by some other symtab, except for our linetable.
Free that now. */
if (LINETABLE (s))
mfree (s->objfile->md, (PTR) LINETABLE (s));
xmfree (s->objfile->md, (PTR) LINETABLE (s));
break;
}
/* If there is a single block of memory to free, free it. */
if (s->free_ptr != NULL)
mfree (s->objfile->md, s->free_ptr);
xmfree (s->objfile->md, s->free_ptr);
/* Free source-related stuff */
if (s->line_charpos != NULL)
mfree (s->objfile->md, (PTR) s->line_charpos);
xmfree (s->objfile->md, (PTR) s->line_charpos);
if (s->fullname != NULL)
mfree (s->objfile->md, s->fullname);
xmfree (s->objfile->md, s->fullname);
if (s->debugformat != NULL)
mfree (s->objfile->md, s->debugformat);
mfree (s->objfile->md, (PTR) s);
xmfree (s->objfile->md, s->debugformat);
xmfree (s->objfile->md, (PTR) s);
}
void

View File

@ -1860,7 +1860,7 @@ xcoff_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_private != NULL)
{
mfree (objfile->md, objfile->sym_private);
xmfree (objfile->md, objfile->sym_private);
}
/* Start with a fresh include table for the next objfile. */