aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-08-10 21:16:13 +0000
committerAndrew Cagney <cagney@redhat.com>2004-08-10 21:16:13 +0000
commitaa2ee5f640b5705d29a7c4f37b3abbfd30a08620 (patch)
treed4acd2adc7c906f8ed20b07a1f846b9d074f2645 /gdb
parent0efffb96a98349f8305e81ec4103dacec4e59baf (diff)
downloadgdb-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')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/ada-lang.c4
-rw-r--r--gdb/defs.h1
-rw-r--r--gdb/symtab.c4
-rw-r--r--gdb/utils.c36
5 files changed, 26 insertions, 26 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ca4adb0..9192d67 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
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.
+
* defs.h (xmrealloc): Delete.
* utils.c (xmrealloc): Delete.
(xrealloc): Inline calls to xmrealloc, mmalloc and mrealloc.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 2a83d85..1bb3ca0 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10261,9 +10261,9 @@ Show the maximum number of bytes allowed in a dynamic-sized object.",
obstack_init (&symbol_list_obstack);
- decoded_names_store = htab_create_alloc_ex
+ decoded_names_store = htab_create_alloc
(256, htab_hash_string, (int (*)(const void *, const void *)) streq,
- NULL, NULL, xmcalloc, xmfree);
+ NULL, xcalloc, xfree);
}
/* Create a fundamental Ada type using default reasonable for the current
diff --git a/gdb/defs.h b/gdb/defs.h
index 4a193fe..c91fd6b 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -875,7 +875,6 @@ extern char *mstrsave (void *, const char *);
/* Robust versions of same. Throw an internal error when no memory,
guard against stray NULL arguments. */
-extern void *xmcalloc (void *md, size_t number, size_t size);
extern void xmfree (void *md, void *ptr);
/* xmalloc(), xrealloc() and xcalloc() have already been declared in
diff --git a/gdb/symtab.c b/gdb/symtab.c
index cd6dd5d..7684bf9 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -431,9 +431,9 @@ create_demangled_names_hash (struct objfile *objfile)
Choosing a much larger table size wastes memory, and saves only about
1% in symbol reading. */
- objfile->demangled_names_hash = htab_create_alloc_ex
+ objfile->demangled_names_hash = htab_create_alloc
(256, htab_hash_string, (int (*) (const void *, const void *)) streq,
- NULL, objfile->md, xmcalloc, xmfree);
+ NULL, xcalloc, xfree);
}
/* Try to determine the demangled name for a symbol, based on the
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