comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Pitfall: freeing access discriminants
Date: 22 Feb 2003 14:00:49 -0500
Date: 2003-02-22T14:00:49-05:00	[thread overview]
Message-ID: <wccy94816ou.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: E18jbD6-0005Re-00@porton.narod.ru

porton@ex-code.com (Victor Porton) writes:

> In my understanding there may be several standard access pool and the 
> pool for access Integer and for Integer_Ptr may be different. Isn't it 
> so?

That's correct.  If you don't say "for T'Storage_Pool use...", the
implementation can use any storage pool it likes.  It can put all such
types in the same global heap, or it can create a new pool for each
type, or anything in between.

I think what you want is something like:

    type Int_Ptr is access Integer;

    type T(X: Int_Ptr) is new Limited_Controlled...

Then you can safely deallocate X using an Unchecked_Deallocation for
Int_Ptr.

- Bob




  reply	other threads:[~2003-02-22 19:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-13 12:41 Pitfall: freeing access discriminants Grein, Christoph
2003-02-13 13:38 ` Victor Porton
2003-02-13 20:49   ` tmoran
2003-02-13 21:17     ` Simon Wright
2003-02-14  4:16       ` tmoran
2003-02-14 21:30         ` Simon Wright
2003-02-14  8:28     ` Victor Porton
2003-02-22 19:00       ` Robert A Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-14  6:21 Grein, Christoph
2003-02-14  6:02 Grein, Christoph
2003-02-13 10:04 Victor Porton
2003-02-13 12:07 ` Victor Porton
2003-02-13 13:42   ` Preben Randhol
2003-02-13 17:40 ` Stephen Leake
2003-02-13 19:24   ` Victor Porton
replies disabled

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