Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 46645 invoked from network); 20 Feb 2008 19:37:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 19:37:45 -0000 Received: (qmail 81170 invoked by uid 500); 20 Feb 2008 19:37:40 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 81151 invoked by uid 500); 20 Feb 2008 19:37:40 -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 81142 invoked by uid 99); 20 Feb 2008 19:37:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 11:37:40 -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; Wed, 20 Feb 2008 19:37:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 074291A9832; Wed, 20 Feb 2008 11:37:16 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r629584 - /stdcxx/trunk/include/string.cc Date: Wed, 20 Feb 2008 19:37:15 -0000 To: commits@stdcxx.apache.org From: faridz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080220193716.074291A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: faridz Date: Wed Feb 20 11:37:12 2008 New Revision: 629584 URL: http://svn.apache.org/viewvc?rev=629584&view=rev Log: 2008-02-20 Farid Zaripov * include/string.cc (__rw_replace): Removed unused variable __delta. (__rw_replace_aux): Removed unused typedef. Used ::operator new() and ::operator delete() instead of std::allocator::allocate() and std::allocator::deallocate() respectively (since private base class std::allocator is not accessible in __rw_replace_aux()). Modified: stdcxx/trunk/include/string.cc Modified: stdcxx/trunk/include/string.cc URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/string.cc?rev=629584&r1=629583&r2=629584&view=diff ============================================================================== --- stdcxx/trunk/include/string.cc (original) +++ stdcxx/trunk/include/string.cc Wed Feb 20 11:37:12 2008 @@ -535,8 +535,6 @@ // compute the size of new buffer const size_type __cap = __s3._C_grow (__s3.size (), size_type ()); - const size_type __delta = __cap - __s3.size (); - // allocate a new buffer _C_string_ref_type *__tmp = __s3._C_get_rep (__cap, __cap); @@ -582,9 +580,6 @@ typedef _RW::__string_ref _C_string_ref_type; - typedef _RWSTD_ALLOC_TYPE (allocator_type, value_type) - _C_value_alloc_type; - # else // if !defined (_RWSTD_NO_STRING_OUTLINED_MEMBER_TEMPLATES) template @@ -660,8 +655,9 @@ &_RWSTD_REINTERPRET_CAST (const_reference, *__first2); if (__s.data () <= __ptr && __s.data () + __ssize > __ptr) { - __tmp = _RWSTD_VALUE_ALLOC (_C_value_alloc_type, __s, - allocate (__n2)); + const _RWSTD_SIZE_T __tmp_size = __n2 * sizeof (value_type); + __tmp = _RWSTD_STATIC_CAST (pointer, + ::operator new (__tmp_size)); for (__d = 0; __d < __n2; __d++) traits_type::assign (*(__tmp + __d), *__first2++); } @@ -674,8 +670,7 @@ if (__tmp) { traits_type::copy (__s._C_data + __pos, __tmp, __n2); - _RWSTD_VALUE_ALLOC (_C_value_alloc_type, __s, - deallocate (__tmp, __n2)); + ::operator delete (__tmp); } else { for (__d = 0; __d < __n2; __d++)