summaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index cbaf0cc9dfd..596c0aee3b9 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -931,6 +931,12 @@ request_quit (signo)
#if !defined (USE_MMALLOC)
+void *
+mcalloc (void *md, size_t number, size_t size)
+{
+ return calloc (number, size);
+}
+
PTR
mmalloc (md, size)
PTR md;
@@ -1092,6 +1098,17 @@ xmalloc (size)
return (xmmalloc ((PTR) NULL, size));
}
+/* Like calloc but get error if no storage available */
+
+PTR
+xcalloc (size_t number, size_t size)
+{
+ void *mem = mcalloc (NULL, number, size);
+ if (mem == NULL)
+ nomem (number * size);
+ return mem;
+}
+
/* Like mrealloc but get error if no storage available. */
PTR