comp.lang.ada
 help / color / mirror / Atom feed
* Deallocation via class-wide pointer
@ 1996-11-22  0:00 Simon Wright
  1996-11-25  0:00 ` Norman H. Cohen
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Wright @ 1996-11-22  0:00 UTC (permalink / 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




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

end of thread, other threads:[~1996-11-25  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-22  0:00 Deallocation via class-wide pointer Simon Wright
1996-11-25  0:00 ` Norman H. Cohen

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