From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec2a500cce3658c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.litech.org!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Memory leak - What the ...? References: From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 13 Oct 2004 00:32:34 GMT NNTP-Posting-Host: 64.185.133.124 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1097627554 64.185.133.124 (Tue, 12 Oct 2004 17:32:34 PDT) NNTP-Posting-Date: Tue, 12 Oct 2004 17:32:34 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:5119 Date: 2004-10-13T00:32:34+00:00 List-Id: Brian May writes: > Why does 1 create result in 2 adjusts and 3 finalize? > (I would have expected number of adjust == number of finalize == 1) Create is probably creating a controlled temporary, that is immediately destroyed following the assignment. > Why are there 2 finalize at the end? > (I would have expected 1 maximum) > > Is there anyway of making this code more efficient? > (It seems to me that a deep copy for a create operation just causes > heap fragmentation with no real benefit.) Implement Create as I showed in my previous posts, then rerun your program and post your results.