badalloc1.C (arena_size): Scale according to target pointer size.
authorHans-Peter Nilsson <hp@axis.com>
Tue, 2 Sep 2014 17:00:28 +0000 (17:00 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Tue, 2 Sep 2014 17:00:28 +0000 (17:00 +0000)
* g++.old-deja/g++.eh/badalloc1.C [!STACK_SIZE && !__FreeBSD__]
[!__sun__ && !__hpux__] (arena_size): Scale according to
target pointer size.

From-SVN: r214828

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C

index fa8fb470d66e19681b08a5c718448f710725cdde..0be30a7bf5292c60d0ea9fa397671080c53310c6 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-02  Hans-Peter Nilsson  <hp@axis.com>
+
+       * g++.old-deja/g++.eh/badalloc1.C [!STACK_SIZE && !__FreeBSD__]
+       [!__sun__ && !__hpux__] (arena_size): Scale according to
+       target pointer size.
+
 2014-09-02  Marek Polacek  <polacek@redhat.com>
 
        PR fortran/62270
index c0341019845f402e1aaacd21f9b1ad8a9a371bda..5cde10ee2726ae4f4ab08a7062bc71e7c7916133 100644 (file)
@@ -3,7 +3,7 @@
 // itself call malloc(), and will fail if there is no more
 // memory available.
 // { dg-do run { xfail { { xstormy16-*-* *-*-darwin[3-7]* } || vxworks_rtp } } }
-// Copyright (C) 2000, 2002, 2003, 2010, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2003, 2010, 2012, 2014 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com>
 
 // Check we can throw a bad_alloc exception when malloc dies.
@@ -23,7 +23,10 @@ const int arena_size = 256;
 // FreeBSD 5 now requires over 131072 bytes.
 const int arena_size = 262144;
 #else
-const int arena_size = 32768;
+// Because pointers make up the bulk of our exception-initialization
+// allocations, we scale by the pointer size from the original
+// 32-bit-systems-based estimate.
+const int arena_size = 32768 * ((sizeof (void *) + 3)/4);
 #endif
 #endif