aboutsummaryrefslogtreecommitdiffstats
path: root/alloca.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-15 23:12:49 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-15 23:12:49 +0300
commit3697ec5ca140f686643d204a54181a5ddbf9a799 (patch)
tree592873e8614475012ddd5f4e6d0482acadbfc9e2 /alloca.c
parentf3d9dd233ac07f764a554528c85be3768a1d1ddb (diff)
downloadegawk-3697ec5ca140f686643d204a54181a5ddbf9a799.tar.gz
egawk-3697ec5ca140f686643d204a54181a5ddbf9a799.tar.bz2
egawk-3697ec5ca140f686643d204a54181a5ddbf9a799.zip
Moved to gawk 2.11.
Diffstat (limited to 'alloca.c')
-rw-r--r--alloca.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/alloca.c b/alloca.c
index cfe98f92..d825b4b6 100644
--- a/alloca.c
+++ b/alloca.c
@@ -42,8 +42,8 @@ you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
-#endif static
-#endif emacs
+#endif /* static */
+#endif /* emacs */
#ifdef X3J11
typedef void *pointer; /* generic pointer type */
@@ -189,3 +189,17 @@ alloca (size) /* returns pointer to storage */
}
}
+pointer xmalloc(n)
+unsigned int n;
+{
+ extern pointer malloc();
+ pointer cp;
+ static char mesg[] = "xmalloc: no memory!\n";
+
+ cp = malloc(n);
+ if (! cp) {
+ write (2, mesg, sizeof(mesg) - 1);
+ exit(1);
+ }
+ return cp;
+}