summaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-12-22 21:45:00 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-12-22 21:45:00 +0000
commit2800c5dc333169fb3e1d2bed6f96912ec8cf982c (patch)
treeea29215395ff424fd4060ad305c1b84ae3f3f90c /gdb/utils.c
parent25f56f63638eebc41a9b95296eebb40563ea0db5 (diff)
downloadgdb-2800c5dc333169fb3e1d2bed6f96912ec8cf982c.tar.gz
import gdb-1999-12-21 snapshotgdb-1999-12-21
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