aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2016-07-29 16:40:55 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2016-07-29 16:40:55 +0000
commitac631cbe7021105c7fb8438deaeef66fe544b9aa (patch)
tree3d4145b4bb447027e2ff796ee99f67e8c5f563b3 /include
parentd51553e083cbed3f5c334573adc999654fb26df2 (diff)
downloadgcc-ac631cbe7021105c7fb8438deaeef66fe544b9aa.zip
gcc-ac631cbe7021105c7fb8438deaeef66fe544b9aa.tar.gz
gcc-ac631cbe7021105c7fb8438deaeef66fe544b9aa.tar.bz2
libiberty.h (MAX_ALLOCA_SIZE): New macro.
include/ * libiberty.h (MAX_ALLOCA_SIZE): New macro. libiberty/ * make-relative-prefix.c (make_relative_prefix_1): Fall back to malloc if alloca argument is greater than MAX_ALLOCA_SIZE. From-SVN: r238880
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/libiberty.h11
2 files changed, 15 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 8b46056..06be028 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-29 Aldy Hernandez <aldyh@redhat.com>
+
+ * libiberty.h (MAX_ALLOCA_SIZE): New macro.
+
2016-05-26 Chung-Lin Tang <cltang@codesourcery.com>
* gomp-constants.h (GOMP_VERSION): Increment to 1, add comment to
diff --git a/include/libiberty.h b/include/libiberty.h
index a9c885f..605ff56 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -397,6 +397,17 @@ extern void hex_init (void);
/* Save files used for communication between processes. */
#define PEX_SAVE_TEMPS 0x4
+/* Max number of alloca bytes per call before we must switch to malloc.
+
+ ?? Swiped from gnulib's regex_internal.h header. Is this actually
+ the case? This number seems arbitrary, though sane.
+
+ The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots. */
+#define MAX_ALLOCA_SIZE 4032
+
/* Prepare to execute one or more programs, with standard output of
each program fed to standard input of the next.
FLAGS As above.