comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Stupid Question but it bothers me
Date: Mon, 19 Jan 2015 16:24:39 -0800 (PST)
Date: 2015-01-19T16:24:39-08:00	[thread overview]
Message-ID: <6ab3d681-9b5b-41ef-b3b1-80ac39c783ef@googlegroups.com> (raw)
In-Reply-To: <6Tgvw.1229422$Rp.389422@fx23.iad>

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 : <instantiated Ada.Containers.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


  reply	other threads:[~2015-01-20  0:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 23:58 Stupid Question but it bothers me Hubert
2015-01-20  0:24 ` sbelmont700 [this message]
2015-01-20  1:24   ` Hubert
2015-01-20  2:58     ` David Botton
2015-01-20  4:27       ` Hubert
2015-01-20  4:54         ` David Botton
2015-01-20  4:55     ` Jeffrey Carter
2015-01-20  8:20       ` Simon Wright
2015-01-20  3:00 ` David Botton
2015-01-20  4:29   ` Hubert
2015-01-20  4:56     ` David Botton
2015-01-20  5:06       ` Hubert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox