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 Path: g2news1.google.com!news1.google.com!news.glorb.com!news.agarik.com!213.56.31.76.MISMATCH!oleane.net!oleane!skymaster!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Memory leak - What the ...? Date: Tue, 12 Oct 2004 10:45:44 +0200 Organization: Adalog Message-ID: References: NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: s5.feed.news.oleane.net 1097572166 5880 195.25.228.57 (12 Oct 2004 09:09:26 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 12 Oct 2004 09:09:26 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.2) Gecko/20040803 X-Accept-Language: fr-fr, en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:5079 Date: 2004-10-12T10:45:44+02:00 List-Id: Brian May a =E9crit : > Why does 1 create result in 2 adjusts and 3 finalize? > (I would have expected number of adjust =3D=3D number of finalize =3D=3D= 1) >=20 > Why are there 2 finalize at the end? > (I would have expected 1 maximum) >=20 > 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.) The magic formula is: Number_Of_Finalize =3D Number_Of_Initialize + Number_Of_Adjust +=20 Number_Of_Aggregates Remember that aggregates are objects which have no initialize (they are=20 supposed to be created correctly). They are finalized, though. --=20 --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr