* defs.h (xmfree): Delete.
* utils.c (xmfree): Delete function.
(xfree): Inline calls to xmfree and mfree.
* symmisc.c (free_symtab_block, free_symtab): Use xfree.
* symfile.c (reread_symbols, init_psymbol_list): Ditto.
* source.c (forget_cached_source_info, find_and_open_source): Ditto.
* somread.c (som_symfile_finish): Ditto.
* objfiles.c (allocate_objfile, free_objfile):
* nlmread.c (nlm_symfile_finish): Ditto.
* hpread.c (hpread_symfile_finish): Ditto.
* elfread.c (free_elfinfo, elf_symfile_finish): Ditto.
* dbxread.c (dbx_symfile_finish, free_bincl_list): Ditto.
* coffread.c (coff_symfile_finish): Ditto.
2004-08-10 Andrew Cagney <cagney@gnu.org>
+ * defs.h (xmfree): Delete.
+ * utils.c (xmfree): Delete function.
+ (xfree): Inline calls to xmfree and mfree.
+ * symmisc.c (free_symtab_block, free_symtab): Use xfree.
+ * symfile.c (reread_symbols, init_psymbol_list): Ditto.
+ * source.c (forget_cached_source_info, find_and_open_source): Ditto.
+ * somread.c (som_symfile_finish): Ditto.
+ * objfiles.c (allocate_objfile, free_objfile):
+ * nlmread.c (nlm_symfile_finish): Ditto.
+ * hpread.c (hpread_symfile_finish): Ditto.
+ * elfread.c (free_elfinfo, elf_symfile_finish): Ditto.
+ * dbxread.c (dbx_symfile_finish, free_bincl_list): Ditto.
+ * coffread.c (coff_symfile_finish): Ditto.
+
* defs.h (xmcalloc): Delete declaration.
* utils.c (xmcalloc): Delete.
(xcalloc): Inline calls to xmcalloc and mcalloc.
{
if (objfile->sym_private != NULL)
{
- xmfree (objfile->md, objfile->sym_private);
+ xfree (objfile->sym_private);
}
/* Let stabs reader clean up */
}
xfree (hfiles);
}
- xmfree (objfile->md, objfile->sym_stab_info);
+ xfree (objfile->sym_stab_info);
}
free_header_files ();
}
static void
free_bincl_list (struct objfile *objfile)
{
- xmfree (objfile->md, bincl_list);
+ xfree (bincl_list);
bincls_allocated = 0;
}
extern char *mstrsave (void *, const char *);
-/* Robust versions of same. Throw an internal error when no memory,
- guard against stray NULL arguments. */
-extern void xmfree (void *md, void *ptr);
-
/* xmalloc(), xrealloc() and xcalloc() have already been declared in
"libiberty.h". */
extern void xfree (void *);
while (ssi)
{
nssi = ssi->next;
- xmfree (objfile->md, ssi);
+ xfree (ssi);
ssi = nssi;
}
{
if (objfile->sym_stab_info != NULL)
{
- xmfree (objfile->md, objfile->sym_stab_info);
+ xfree (objfile->sym_stab_info);
}
}
{
if (objfile->sym_private != NULL)
{
- xmfree (objfile->md, objfile->sym_private);
+ xfree (objfile->sym_private);
}
}
\f
{
if (objfile->sym_private != NULL)
{
- xmfree (objfile->md, objfile->sym_private);
+ xfree (objfile->sym_private);
}
}
objfile->obfd = abfd;
if (objfile->name != NULL)
{
- xmfree (objfile->md, objfile->name);
+ xfree (objfile->name);
}
if (abfd != NULL)
{
objfile_free_data (objfile);
if (objfile->name != NULL)
{
- xmfree (objfile->md, objfile->name);
+ xfree (objfile->name);
}
if (objfile->global_psymbols.list)
- xmfree (objfile->md, objfile->global_psymbols.list);
+ xfree (objfile->global_psymbols.list);
if (objfile->static_psymbols.list)
- xmfree (objfile->md, objfile->static_psymbols.list);
+ xfree (objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles */
bcache_xfree (objfile->psymbol_cache);
bcache_xfree (objfile->macro_cache);
if (objfile->demangled_names_hash)
htab_delete (objfile->demangled_names_hash);
obstack_free (&objfile->objfile_obstack, 0);
- xmfree (objfile->md, objfile);
+ xfree (objfile);
objfile = NULL;
}
{
if (objfile->sym_stab_info != NULL)
{
- xmfree (objfile->md, objfile->sym_stab_info);
+ xfree (objfile->sym_stab_info);
}
hpread_symfile_finish (objfile);
}
{
if (s->line_charpos != NULL)
{
- xmfree (objfile->md, s->line_charpos);
+ xfree (s->line_charpos);
s->line_charpos = NULL;
}
if (s->fullname != NULL)
{
- xmfree (objfile->md, s->fullname);
+ xfree (s->fullname);
s->fullname = NULL;
}
}
if (result >= 0)
return result;
/* Didn't work -- free old one, try again. */
- xmfree (objfile->md, *fullname);
+ xfree (*fullname);
*fullname = NULL;
}
/* FIXME: Do we have to free a whole linked list, or is this
enough? */
if (objfile->global_psymbols.list)
- xmfree (objfile->md, objfile->global_psymbols.list);
+ xfree (objfile->global_psymbols.list);
memset (&objfile->global_psymbols, 0,
sizeof (objfile->global_psymbols));
if (objfile->static_psymbols.list)
- xmfree (objfile->md, objfile->static_psymbols.list);
+ xfree (objfile->static_psymbols.list);
memset (&objfile->static_psymbols, 0,
sizeof (objfile->static_psymbols));
if (objfile->global_psymbols.list)
{
- xmfree (objfile->md, objfile->global_psymbols.list);
+ xfree (objfile->global_psymbols.list);
}
if (objfile->static_psymbols.list)
{
- xmfree (objfile->md, objfile->static_psymbols.list);
+ xfree (objfile->static_psymbols.list);
}
/* Current best guess is that approximately a twentieth
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
- xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (sym));
- xmfree (objfile->md, sym);
+ xfree (DEPRECATED_SYMBOL_NAME (sym));
+ xfree (sym);
}
dict_free (BLOCK_DICT (b));
- xmfree (objfile->md, b);
+ xfree (b);
}
/* Free all the storage associated with the struct symtab <- S.
for (i = 0; i < n; i++)
free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i));
/* Free the blockvector itself. */
- xmfree (s->objfile->md, bv);
+ xfree (bv);
/* Also free the linetable. */
case free_linetable:
or by some other symtab, except for our linetable.
Free that now. */
if (LINETABLE (s))
- xmfree (s->objfile->md, LINETABLE (s));
+ xfree (LINETABLE (s));
break;
}
/* Free source-related stuff */
if (s->line_charpos != NULL)
- xmfree (s->objfile->md, s->line_charpos);
+ xfree (s->line_charpos);
if (s->fullname != NULL)
- xmfree (s->objfile->md, s->fullname);
+ xfree (s->fullname);
if (s->debugformat != NULL)
- xmfree (s->objfile->md, s->debugformat);
- xmfree (s->objfile->md, s);
+ xfree (s->debugformat);
+ xfree (s);
}
void
}
}
-void
-xmfree (void *md, void *ptr)
-{
- if (ptr != NULL)
- mfree (md, ptr);
-}
-
/* The xmalloc() (libiberty.h) family of memory management routines.
These are like the ISO-C malloc() family except that they implement
void
xfree (void *ptr)
{
- xmfree (NULL, ptr);
+ if (ptr != NULL)
+ free (ptr); /* OK: free */
}
\f