comp.lang.ada
 help / color / mirror / Atom feed
From: simon.j.wright@gecm.com (Simon Wright)
Subject: Deallocation via class-wide pointer
Date: 1996/11/22
Date: 1996-11-22T00:00:00+00:00	[thread overview]
Message-ID: <x7vralm3vqf.fsf@luthien.frlngtn.gmcs.gecm.com> (raw)


I have a type T and a class-wide pointer:

  type T is tagged with null record;
  type TP is access T'Class;

I have a queue of T's (and, of course, types extended from T) to
process. The individual objects are allocated dynamically and put into
some Queue package, which manages TP's.

What I want to do is to pop the objects off the queue, process them
(via some appropriate dispatching operation) and then deallocate the
memory.

For the life of me I can't see how to get to call

  type TPP is access T;
  procedure Free is new Unchecked_Deallocation (T, TPP);

This must be a common problem, I guess I'm just looking at it wrong;
any thoughts?


-- 
Simon Wright                                    (G-net) +842-1778
Ferranti Naval Systems                  (voice) +44(0)1705-701778
GEC-Marconi S3I Combat Systems Division   (fax) +44(0)1705-701800




             reply	other threads:[~1996-11-22  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-22  0:00 Simon Wright [this message]
1996-11-25  0:00 ` Deallocation via class-wide pointer Norman H. Cohen
replies disabled

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