Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 58718 invoked from network); 22 Feb 2008 19:39:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 19:39:13 -0000 Received: (qmail 88435 invoked by uid 500); 22 Feb 2008 19:39:08 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 88424 invoked by uid 500); 22 Feb 2008 19:39:08 -0000 Mailing-List: contact dev-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 dev@stdcxx.apache.org Received: (qmail 88415 invoked by uid 99); 22 Feb 2008 19:39:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 11:39:08 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 19:38:22 +0000 Received: from nebula.bco.roguewave.com ([10.70.3.27]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m1MJcfsK021217 for ; Fri, 22 Feb 2008 19:38:41 GMT Message-ID: <47BF24BE.8070003@roguewave.com> Date: Fri, 22 Feb 2008 12:38:38 -0700 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: svn commit: r629584 - /stdcxx/trunk/include/string.cc References: <20080220193716.074291A9832@eris.apache.org> In-Reply-To: <20080220193716.074291A9832@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org faridz@apache.org wrote: > 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()). I don't think we're allowed to bypass the allocator and call new directly. Martin > > 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++) > >