From stdcxx-commits-return-211-apmail-incubator-stdcxx-commits-archive=incubator.apache.org@incubator.apache.org Thu Dec 01 23:35:28 2005 Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 57307 invoked from network); 1 Dec 2005 23:35:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Dec 2005 23:35:21 -0000 Received: (qmail 77378 invoked by uid 500); 1 Dec 2005 23:35:13 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 77312 invoked by uid 500); 1 Dec 2005 23:35:13 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 77261 invoked by uid 500); 1 Dec 2005 23:35:13 -0000 Delivered-To: apmail-incubator-stdcxx-cvs@incubator.apache.org Received: (qmail 77240 invoked by uid 99); 1 Dec 2005 23:35:13 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 01 Dec 2005 15:35:13 -0800 Received: (qmail 56838 invoked by uid 65534); 1 Dec 2005 23:34:52 -0000 Message-ID: <20051201233452.56835.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r351522 - /incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp Date: Thu, 01 Dec 2005 23:34:52 -0000 To: stdcxx-cvs@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Thu Dec 1 15:34:42 2005 New Revision: 351522 URL: http://svn.apache.org/viewcvs?rev=351522&view=rev Log: 2005-12-01 Martin Sebor * NEW_THROWS.cpp: Corrected a printf statement in conditionally compiled code. Simplified/corrected loop allocating large amounts of memory and explicitly #defined the config macro on test failure instead of relying on the infrastructure to do it. Modified: incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp Modified: incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp?rev=351522&r1=351521&r2=351522&view=diff ============================================================================== --- incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp (original) +++ incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp Thu Dec 1 15:34:42 2005 @@ -11,8 +11,9 @@ #endif // _RWSTD_NO_SETRLIMIT -#ifndef _RWSTD_NO_HONOR_STD -# ifdef _RWSTD_NO_STD_TERMINATE +#if 2 == __GNUG__ +# ifndef _RWSTD_NO_HONOR_STD +# ifdef _RWSTD_NO_STD_TERMINATE namespace std { @@ -32,8 +33,9 @@ } // namespace std -# endif // _RWSTD_NO_STD_TERMINATE -#endif // _RWSTD_NO_HONOR_STD +# endif // _RWSTD_NO_STD_TERMINATE +# endif // _RWSTD_NO_HONOR_STD +#endif // gcc 2.x #if (defined (_WIN32) || defined (_WIN64)) && !defined (__CYGWIN__) @@ -63,7 +65,7 @@ int main () { #if !defined (_RWSTD_USE_CONFIG) - printf ("#undef _RWSTD_NO_NEW_THROWS\n"); + printf ("/**/\n#undef _RWSTD_NO_NEW_THROWS\n"); #endif nodbg (); @@ -101,10 +103,11 @@ p = (void*)1; try { - for (unsigned long n = 1U << sizeof (long) * 8 - 1; - p && 0 != n; n = n | (n >> 1)) { + const size_t size = (size_t)1 << (sizeof (size_t) * 8 - 1); + + for (int i = 0; i != 256; ++i) { // try to allocate a huge amount of memory - p = ::operator new (n); + p = ::operator new (size); // do not delete } } @@ -112,5 +115,7 @@ return 0; } - return 1; + printf ("#define _RWSTD_NO_NEW_THROWS\n"); + + return 0; }