aboutsummaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r--gcc/gensupport.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index ce4869b..cde2a22 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -863,6 +863,21 @@ xstrdup (input)
}
PTR
+xcalloc (nelem, elsize)
+ size_t nelem, elsize;
+{
+ PTR newmem;
+
+ if (nelem == 0 || elsize == 0)
+ nelem = elsize = 1;
+
+ newmem = calloc (nelem, elsize);
+ if (!newmem)
+ fatal ("virtual memory exhausted");
+ return (newmem);
+}
+
+PTR
xrealloc (old, size)
PTR old;
size_t size;