summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-08 16:47:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-08 16:47:29 +0000
commit8bceedc67ca3ec732f7d6524cb023352d4aaf0c7 (patch)
tree2411ab1a9a1a6cbe2460165a4b9e65f6ac2b9307
parent791312e7259153e1235f14a9a9e5cc6055ce8dfc (diff)
Make alloca work using the compiler builtin
-Erik
-rw-r--r--include/stdlib.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 54c2a6fa7..f802d337e 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -65,6 +65,12 @@ extern __ptr_t calloc __P ((size_t, size_t));
extern __ptr_t malloc __P ((size_t));
extern __ptr_t realloc __P ((__ptr_t, size_t));
extern void free __P ((__ptr_t));
+/* Allocate a block on the stack that will be freed
+ * when the calling function exits. We use gcc's
+ * version to make life better... */
+#undef alloca
+extern __ptr_t alloca __P ((size_t __size));
+#define alloca(size) __builtin_alloca (size)
#ifdef DEBUG_MALLOC
extern __ptr_t calloc_dbg __P ((size_t, size_t, char* func, char* file, int line));