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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b3258fa06e2efdf3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-11 08:35:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed.stueberl.de!teaser.fr!wanadoo.fr!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: Re: Tasks unleashed Date: 11 May 2003 17:35:18 +0200 Organization: Home - http://perso.wanadoo.fr/pascal.obry Message-ID: References: <5Ejsa.430589$OV.427578@rwcrnsc54> NNTP-Posting-Host: avelizy-103-1-1-57.w217-128.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news-reader12.wanadoo.fr 1052667325 4486 217.128.141.57 (11 May 2003 15:35:26 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 11 May 2003 15:35:26 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.95 Xref: archiver1.google.com comp.lang.ada:37182 Date: 2003-05-11T15:35:26+00:00 List-Id: Craig Carey writes: > Recovering the memory of a task silently fails if the task was not > finished. > > ** Test 1: the memory leak is completely absent: > for K in 1 .. 20_000 loop -- N=20,000 > X := new A.Tt; > N := N + 1; > X.The_End; > delay 1.0E-30; -- [1] > Free (X); -- [2] > end loop; [1] is not right here. The delay could still not be enough. What I usually do is loop until 'Terminated is true. Something like: (not compiled) for K in 1 .. 20_000 loop -- N=20,000 X := new A.Tt; N := N + 1; X.The_End; loop exit when X'Terminated; delay 1.0E-30; -- [1] end loop; Free (X); -- [2] end loop; Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://perso.wanadoo.fr/pascal.obry --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595