Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 14599 invoked from network); 19 Feb 2008 19:55:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Feb 2008 19:55:46 -0000 Received: (qmail 20435 invoked by uid 500); 19 Feb 2008 19:55:41 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 20424 invoked by uid 500); 19 Feb 2008 19:55:41 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 20415 invoked by uid 99); 19 Feb 2008 19:55:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 11:55:41 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 19:55:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3591E1A9832; Tue, 19 Feb 2008 11:55:25 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r629207 - in /stdcxx/trunk/include: sstream sstream.cc Date: Tue, 19 Feb 2008 19:55:24 -0000 To: commits@stdcxx.apache.org From: vitek@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080219195525.3591E1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vitek Date: Tue Feb 19 11:55:21 2008 New Revision: 629207 URL: http://svn.apache.org/viewvc?rev=629207&view=rev Log: 2008-02-19 Travis Vitek STDCXX-602 * include/sstream (_C_grow): Remove declaration and definition of private method. * include/sstream.cc (str): Calculate the appropriate buffer size directly, removing call to removed method _C_grow(). Modified: stdcxx/trunk/include/sstream stdcxx/trunk/include/sstream.cc Modified: stdcxx/trunk/include/sstream URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/sstream?rev=629207&r1=629206&r2=629207&view=diff ============================================================================== --- stdcxx/trunk/include/sstream (original) +++ stdcxx/trunk/include/sstream Tue Feb 19 11:55:21 2008 @@ -170,8 +170,6 @@ private: - _RWSTD_STREAMSIZE _C_grow (_RWSTD_STREAMSIZE) const; - // called from overflow, underflow, et al to get egptr() // caught up with pptr() void _C_catchup (char_type*); @@ -199,25 +197,6 @@ } return _C_string_type (__first, __last); -} - - -template -inline _RWSTD_STREAMSIZE -basic_stringbuf<_CharT, _Traits, _Allocator>:: -_C_grow (_RWSTD_STREAMSIZE __to) const -{ - const _RWSTD_STREAMSIZE __ratio = - _RWSTD_STREAMSIZE ( (_RWSTD_NEW_CAPACITY_RATIO << 10) - / _RWSTD_RATIO_DIVIDER); - - const _RWSTD_STREAMSIZE __cap = - this->_C_bufsize ? - (this->_C_bufsize >> 10) * __ratio - + (((this->_C_bufsize & 0x3ff) * __ratio) >> 10) - : _RWSTD_MINIMUM_STRINGBUF_CAPACITY; - - return __cap < __to ? __to : __cap; } Modified: stdcxx/trunk/include/sstream.cc URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/sstream.cc?rev=629207&r1=629206&r2=629207&view=diff ============================================================================== --- stdcxx/trunk/include/sstream.cc (original) +++ stdcxx/trunk/include/sstream.cc Tue Feb 19 11:55:21 2008 @@ -99,7 +99,17 @@ if (this->_C_bufsize < __bufsize) { // requested capacity is greater than the current capacity // allocate a new buffer of sufficient size - __bufsize = _C_grow (__bufsize); + const _RWSTD_STREAMSIZE __ratio = + _RWSTD_STREAMSIZE ( (_RWSTD_NEW_CAPACITY_RATIO << 10) + / _RWSTD_RATIO_DIVIDER); + + const _RWSTD_STREAMSIZE __cap = + this->_C_buffsize ? + (this->_C_buffsize >> 10) * __ratio + + (((this->_C_buffsize & 0x3ff) * __ratio) >> 10) + : _RWSTD_MINIMUM_STRINGBUF_CAPACITY; + + __bufsize = __cap < __bufsize ? __bufsize : __cap; if (__s != this->_C_buffer && this->_C_own_buf ()) { // deallocate the existing buffer here only if the string