Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 83272 invoked from network); 22 May 2007 21:27:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 May 2007 21:27:33 -0000 Received: (qmail 95673 invoked by uid 500); 22 May 2007 21:27:39 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 95647 invoked by uid 500); 22 May 2007 21:27:39 -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 95636 invoked by uid 99); 22 May 2007 21:27:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 14:27:39 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME 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, 22 May 2007 14:27:33 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D91041A981A; Tue, 22 May 2007 14:27:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r540763 - /incubator/stdcxx/trunk/include/rw/_array.h Date: Tue, 22 May 2007 21:27:12 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070522212712.D91041A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebor Date: Tue May 22 14:27:12 2007 New Revision: 540763 URL: http://svn.apache.org/viewvc?view=rev&rev=540763 Log: 2007-05-22 Martin Sebor STDCXX-424 * _array.h (dtor): Simplified and implemented without relying on resize() for efficiency. (resize): Avoided calling trivial inline functions. Modified: incubator/stdcxx/trunk/include/rw/_array.h Modified: incubator/stdcxx/trunk/include/rw/_array.h URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/rw/_array.h?view=diff&rev=540763&r1=540762&r2=540763 ============================================================================== --- incubator/stdcxx/trunk/include/rw/_array.h (original) +++ incubator/stdcxx/trunk/include/rw/_array.h Tue May 22 14:27:12 2007 @@ -67,9 +67,7 @@ __rw_array (const __rw_array&); - ~__rw_array () { - resize (0); - } + ~__rw_array (); __rw_array& operator= (const __rw_array&); @@ -184,6 +182,16 @@ template +inline +__rw_array<_TypeT>:: +~__rw_array<_TypeT> () +{ + __rw_destroy (_C_data, _C_data + _C_size); + ::operator delete (_C_data); +} + + +template inline void __rw_array<_TypeT>::swap (__rw_array<_TypeT> &__rhs) { pointer __tmp_data = begin (); @@ -200,9 +208,9 @@ inline void __rw_array<_TypeT>:: resize (size_type __size, const_reference __val /* = value_type () */) { - if (begin ()) { - __rw_destroy (begin (), end ()); - ::operator delete (begin ()); + if (_C_data) { + __rw_destroy (_C_data, _C_data + _C_size); + ::operator delete (_C_data); _C_data = 0; }