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: a07f3367d7,6d4eecb82d078fd6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.freenet.de!newsfeed1.swip.net!newsfeed1.funet.fi!newsfeed3.funet.fi!newsfeeds.funet.fi!feeder2.news.saunalahti.fi!fi.sn.net!newsfeed2.tdcnet.fi!news.song.fi!not-for-mail Date: Fri, 22 May 2009 18:17:26 +0300 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Exception_Access_Violation References: <3f465d87-0fc9-415d-a60b-72a0d744dce1@h23g2000vbc.googlegroups.com> <77f52dF1gt12kU1@mid.individual.net> <669e505c-f111-47b9-8cc5-ca1815161c53@s20g2000vbp.googlegroups.com> <77nrfgF1iajvfU1@mid.individual.net> In-Reply-To: <77nrfgF1iajvfU1@mid.individual.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4a16c1e3$0$6285$4f793bc4@news.tdc.fi> Organization: TDC Internet Services NNTP-Posting-Host: 81.17.205.61 X-Trace: 1243005411 news.tdc.fi 6285 81.17.205.61:33034 X-Complaints-To: abuse@tdcnet.fi Xref: g2news2.google.com comp.lang.ada:5981 Date: 2009-05-22T18:17:26+03:00 List-Id: Bj�rn Persson wrote: > mhamel_98@yahoo.com wrote: > > >>Problem solved! Thanks for all the help, especially the pointer to >>Debug_Pools. The problem was that instead of allocating one node at a >>time, I was allocating an array of nodes at once. Deallocating nodes >>allocated from an array allocation is apparently bad juju. I don't >>understand it, but can work around it. > > > When you have allocated an array you must also deallocate it as an array. > You can't deallocate individual elements of an array. Just to add to Bj�rn's comment: If you have an indexed collection of nodes, and want to deallocate nodes at some indices without deallocating them all at once, you can make an array of access values. For example: type Node is ... type Node_Ref is access Node; procedure Deallocate is new Unchecked_Deallocation (...) Collection : array (1 .. 100) of Node_Ref: Now you can do: Collection(5) := new Node; Collection(5) now contains an access to a new Node. Later you can do: Deallocate (Collection(5)); The new node is now deallocated and Collection(5) is null. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .