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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.222.9 with SMTP id s9mr3357396yhp.55.1421713480003; Mon, 19 Jan 2015 16:24:40 -0800 (PST) X-Received: by 10.140.93.18 with SMTP id c18mr13872qge.4.1421713479985; Mon, 19 Jan 2015 16:24:39 -0800 (PST) Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!bm13no1684703qab.0!news-out.google.com!l7ni0qai.0!nntp.google.com!bm13no1684701qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 19 Jan 2015 16:24:39 -0800 (PST) In-Reply-To: <6Tgvw.1229422$Rp.389422@fx23.iad> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: <6Tgvw.1229422$Rp.389422@fx23.iad> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6ab3d681-9b5b-41ef-b3b1-80ac39c783ef@googlegroups.com> Subject: Re: Stupid Question but it bothers me From: sbelmont700@gmail.com Injection-Date: Tue, 20 Jan 2015 00:24:39 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:191921 Date: 2015-01-19T16:24:39-08:00 List-Id: On Monday, January 19, 2015 at 6:58:59 PM UTC-5, Hubert wrote: > Yes, sorry I am sure this is a stupid question but I can not remember > that I read an answer to it in Barne's book. > > suppose you have simple record > > TYPE A_Type IS RECORD > My_Map : ; > END RECORD; > > > now when I allocate a record with NEW obviously the map is correctly > initialized. > > What happens when I deallocate the record with an instantiation of > Ada.Unchecked_Deallocate? is the map correctly destroyed or do I have to > revive my record from Ada.Finalization? I mean there is no obvious > memory leak detector in Ada so I am always a bit blind (on C++ I usually > use VisualLeakDetector). > > I assume, when I store access values in the map I will have to go > through all entries and deallocate them one by one which is fine, but my > question is about the map and it's internal datastructures. Will the > deallocation automatically deallocate elements like the map as well? > > > Thanks > > > > --- > This email has been checked for viruses by Avast antivirus software. > http://www.avast.com A.18.4~81/2 - "No storage associated with a Map object shall be lost upon assignment or scope exit." -sb