diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-15 23:12:49 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-15 23:12:49 +0300 |
commit | 3697ec5ca140f686643d204a54181a5ddbf9a799 (patch) | |
tree | 592873e8614475012ddd5f4e6d0482acadbfc9e2 /alloca.c | |
parent | f3d9dd233ac07f764a554528c85be3768a1d1ddb (diff) | |
download | egawk-3697ec5ca140f686643d204a54181a5ddbf9a799.tar.gz egawk-3697ec5ca140f686643d204a54181a5ddbf9a799.tar.bz2 egawk-3697ec5ca140f686643d204a54181a5ddbf9a799.zip |
Moved to gawk 2.11.
Diffstat (limited to 'alloca.c')
-rw-r--r-- | alloca.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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; +} |