diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-08-10 21:16:13 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-08-10 21:16:13 +0000 |
commit | aa2ee5f640b5705d29a7c4f37b3abbfd30a08620 (patch) | |
tree | d4acd2adc7c906f8ed20b07a1f846b9d074f2645 /gdb/utils.c | |
parent | 0efffb96a98349f8305e81ec4103dacec4e59baf (diff) | |
download | gdb-aa2ee5f640b5705d29a7c4f37b3abbfd30a08620.zip gdb-aa2ee5f640b5705d29a7c4f37b3abbfd30a08620.tar.gz gdb-aa2ee5f640b5705d29a7c4f37b3abbfd30a08620.tar.bz2 |
2004-08-10 Andrew Cagney <cagney@gnu.org>
* defs.h (xmcalloc): Delete declaration.
* utils.c (xmcalloc): Delete.
(xcalloc): Inline calls to xmcalloc and mcalloc.
* ada-lang.c (_initialize_ada_language): Use htab_create_alloc,
xcalloc and xfree.
* symtab.c (create_demangled_names_hash): Ditto.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index af58219..e903aa8 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1037,26 +1037,6 @@ nomem (long size) } } -void * -xmcalloc (void *md, size_t number, size_t size) -{ - void *mem; - - /* See libiberty/xmalloc.c. This function need's to match that's - semantics. It never returns NULL. */ - if (number == 0 || size == 0) - { - number = 1; - size = 1; - } - - mem = mcalloc (md, number, size); - if (mem == NULL) - nomem (number * size); - - return mem; -} - void xmfree (void *md, void *ptr) { @@ -1113,7 +1093,21 @@ xrealloc (PTR ptr, size_t size) /* OK: PTR */ PTR /* OK: PTR */ xcalloc (size_t number, size_t size) { - return xmcalloc (NULL, number, size); + void *mem; + + /* See libiberty/xmalloc.c. This function need's to match that's + semantics. It never returns NULL. */ + if (number == 0 || size == 0) + { + number = 1; + size = 1; + } + + mem = calloc (number, size); /* OK: xcalloc */ + if (mem == NULL) + nomem (number * size); + + return mem; } void |