projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[gnulib.git]
/
lib
/
alloca.c
diff --git
a/lib/alloca.c
b/lib/alloca.c
index
10e5d65
..
6ad425a
100644
(file)
--- a/
lib/alloca.c
+++ b/
lib/alloca.c
@@
-25,6
+25,13
@@
# include <config.h>
#endif
# include <config.h>
#endif
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
#ifdef emacs
# include "blockinput.h"
#endif
#ifdef emacs
# include "blockinput.h"
#endif
@@
-81,6
+88,7
@@
typedef char *pointer;
Callers below should use malloc. */
# ifndef emacs
Callers below should use malloc. */
# ifndef emacs
+# undef malloc
# define malloc xmalloc
# endif
extern pointer malloc ();
# define malloc xmalloc
# endif
extern pointer malloc ();
@@
-161,8
+169,7
@@
static header *last_alloca_header = NULL; /* -> last alloca header. */
implementations of C, for example under Gould's UTX/32. */
pointer
implementations of C, for example under Gould's UTX/32. */
pointer
-alloca (size)
- unsigned size;
+alloca (size_t size)
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
@@
-211,6
+218,9
@@
alloca (size)
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
+ if (new == 0)
+ abort();
+
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;