comp.lang.ada
 help / color / mirror / Atom feed
* Unchecked deallocation question
@ 2004-11-24 15:38 Alex R. Mosteo
  2004-11-24 17:24 ` Jeffrey Carter
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Alex R. Mosteo @ 2004-11-24 15:38 UTC (permalink / raw)


I'm wondering if this is correct:

type Root is tagged record ...

type Root_Access is access Root;

type Derived is new Root with ...

type Derived_Access is access Derived;

procedure Free is
    new Ada.Unchecked_Deallocation (Root'Class, Root_Access);

declare
    It : Derived_Access := new Derived;
begin
    Free (Root_Access (It)); -- <-- THIS DEALLOCATION I'M ASKING
end;

Assuming that all involved access types use the same Storage_Pool.

The purpose is to have a single deallocator in the root package and to 
not have to instantiate a lot of deallocators for derived types.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-11-27  8:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-24 15:38 Unchecked deallocation question Alex R. Mosteo
2004-11-24 17:24 ` Jeffrey Carter
2004-11-24 17:35   ` Alex R. Mosteo
2004-11-24 17:33 ` David Botton
2004-11-25  8:35 ` Martin Krischik
2004-11-25  9:12   ` Alex R. Mosteo
2004-11-25 23:24   ` Adrien Plisson
2004-11-26  4:05     ` Jim Rogers
2004-11-26 10:53       ` Sergey
2004-11-26  9:06     ` Dmitry A. Kazakov
2004-11-26 18:20       ` Sergey
2004-11-27  8:43         ` Dmitry A. Kazakov

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