aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-08-10 20:03:32 +0000
committerAndrew Cagney <cagney@redhat.com>2004-08-10 20:03:32 +0000
commit0efffb96a98349f8305e81ec4103dacec4e59baf (patch)
tree4af60090c4ba9651755ddfc0f40251a351edc16b /gdb/utils.c
parent7936743b083af802de53a9483c450d917e991d46 (diff)
downloadgdb-0efffb96a98349f8305e81ec4103dacec4e59baf.zip
gdb-0efffb96a98349f8305e81ec4103dacec4e59baf.tar.gz
gdb-0efffb96a98349f8305e81ec4103dacec4e59baf.tar.bz2
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.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 3552b8d..af58219 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1038,26 +1038,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)
{
void *mem;
@@ -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 */