2004-08-10 Andrew Cagney <cagney@gnu.org>
* defs.h (xmrealloc): Delete. * utils.c (xmrealloc): Delete. (xrealloc): Inline calls to xmrealloc, mmalloc and mrealloc. * symmisc.c (extend_psymbol_list): Use xrealloc. * source.c (find_source_lines): Ditto. * hpread.c (hpread_lookup_type): Ditto. * dbxread.c (add_bincl_to_list): Ditto.
This commit is contained in:
parent
7936743b08
commit
0efffb96a9
7 changed files with 33 additions and 34 deletions
36
gdb/utils.c
36
gdb/utils.c
|
@ -1037,26 +1037,6 @@ nomem (long size)
|
|||
}
|
||||
}
|
||||
|
||||
void *
|
||||
xmrealloc (void *md, void *ptr, size_t size)
|
||||
{
|
||||
void *val;
|
||||
|
||||
/* See libiberty/xmalloc.c. This function need's to match that's
|
||||
semantics. It never returns NULL. */
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
|
||||
if (ptr != NULL)
|
||||
val = mrealloc (md, ptr, size);
|
||||
else
|
||||
val = mmalloc (md, size);
|
||||
if (val == NULL)
|
||||
nomem (size);
|
||||
|
||||
return (val);
|
||||
}
|
||||
|
||||
void *
|
||||
xmcalloc (void *md, size_t number, size_t size)
|
||||
{
|
||||
|
@ -1113,7 +1093,21 @@ xmalloc (size_t size)
|
|||
PTR /* OK: PTR */
|
||||
xrealloc (PTR ptr, size_t size) /* OK: PTR */
|
||||
{
|
||||
return xmrealloc (NULL, ptr, size);
|
||||
void *val;
|
||||
|
||||
/* See libiberty/xmalloc.c. This function need's to match that's
|
||||
semantics. It never returns NULL. */
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
|
||||
if (ptr != NULL)
|
||||
val = realloc (ptr, size); /* OK: realloc */
|
||||
else
|
||||
val = malloc (size); /* OK: malloc */
|
||||
if (val == NULL)
|
||||
nomem (size);
|
||||
|
||||
return (val);
|
||||
}
|
||||
|
||||
PTR /* OK: PTR */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue