aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/common.h b/common.h
index bf605f5..4953da2 100644
--- a/common.h
+++ b/common.h
@@ -2,13 +2,20 @@
#include "libkeccak.h"
+#ifndef ALLOCA_LIMIT
+# define ALLOCA_LIMIT (16UL << 10)
+#endif
+
+
#include <sys/stat.h>
-#if defined(__GLIBC__) || defined(__sun) || defined(__CYGWIN__)
-# include <alloca.h>
-#elif defined(_WIN32)
-# include <malloc.h>
-# if !defined(alloca)
-# define alloca _alloca /* For clang with MS Codegen */
+#if ALLOCA_LIMIT > 0
+# if defined(__GLIBC__) || defined(__sun) || defined(__CYGWIN__)
+# include <alloca.h>
+# elif defined(_WIN32)
+# include <malloc.h>
+# if !defined(alloca)
+# define alloca _alloca /* For clang with MS Codegen */
+# endif
# endif
#endif
#include <errno.h>