comp.lang.ada
 help / color / mirror / Atom feed
* Freeing Pointers to classwide types
@ 1998-09-24  0:00 joecool
  1998-09-25  0:00 ` alan walkington
                   ` (3 more replies)
  0 siblings, 4 replies; 61+ messages in thread
From: joecool @ 1998-09-24  0:00 UTC (permalink / raw)


Forgive me if this is an old question.  I am new to the group.

I am searching for information regarding the freeing of pointers to
classwide types.  I have been doing a great deal of searching on the web and
numerous texts.

Many texts discuss the use of pointers to classwide types for creating
heterogeneous arrays, buffers, etc. but darn little if nothing at all about
freeing the memory once you allocate it.

I understand (I think) how to dynamically allocate different objects within
a class and place them in a heterogenous list but I'm not sure if I
understand how to properly free the memory.

How do you go about freeing such critters?

Can anyone provide any background on this, or suggestions on where I can
find a detailed discussion of this topic?

Also, does anyone know of any problems in this area with the Aonix ObjectAda
compiler?  (This is NOT one of my favorite development environments!)

I would appreciate any assistance.







^ permalink raw reply	[flat|nested] 61+ messages in thread
* Re: Freeing Pointers to classwide types
@ 1998-09-25  0:00 bpr5549
  0 siblings, 0 replies; 61+ messages in thread
From: bpr5549 @ 1998-09-25  0:00 UTC (permalink / raw)


On Thu, 24 Sep 1998, joecool wrote:
> Forgive me if this is an old question.  I am new to the group.
>
> I am searching for information regarding the freeing of pointers to
> classwide types.  I have been doing a great deal of searching on the web and
> numerous texts.

In what way is the problem changed if you are not dealing with classwide
types, but just looking at the general problem of dynamic allocation? This
problem is not really language specific. The best reference I know of
(besides Knuth vol1 of course) is Paul Wilson's survey at

        http://www.cs.utexas.edu/users/oops/papers.html#allocsrv


> Many texts discuss the use of pointers to classwide types for creating
> heterogeneous arrays, buffers, etc. but darn little if nothing at all about
> freeing the memory once you allocate it.
>
> I understand (I think) how to dynamically allocate different objects within
> a class and place them in a heterogenous list but I'm not sure if I
> understand how to properly free the memory.
>
> How do you go about freeing such critters?

I assume that you know about Unchecked_Deallocation. Barnes second edition
also has some examples of how to write your own storage allocators.

Many of the programs I write are amenable to the strategy of deallocation
based on object lifetimes, i.e., you don't free individual objects but
free them in groups based on their lifetime. This technique is old, and
goes by many names; zones (1960s), arenas (Fraser & Hanson's lcc compiler),
and most recently regions (ML Kit). Ada programmers who've read the
Rationale know it as mark release storage, and the GNAT module s-secsta
is one implementation.

-- Brian

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

end of thread, other threads:[~1998-10-12  0:00 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-24  0:00 Freeing Pointers to classwide types joecool
1998-09-25  0:00 ` alan walkington
1998-09-25  0:00 ` Tom Moran
1998-09-25  0:00   ` Bob Fletcher
1998-09-25  0:00     ` Samuel Tardieu
1998-09-25  0:00     ` dennison
1998-10-09  0:00     ` Matthew Heaney
1998-10-12  0:00       ` Mats Weber
1998-10-12  0:00         ` Pat Rogers
1998-09-25  0:00   ` dewarr
1998-09-25  0:00     ` Tom Moran
1998-09-25  0:00       ` dewarr
1998-09-26  0:00     ` Tom Moran
1998-09-26  0:00       ` dewarr
1998-09-26  0:00         ` Tom Moran
1998-09-27  0:00           ` dewarr
1998-09-27  0:00             ` Tom Moran
1998-09-28  0:00               ` dewarr
1998-09-28  0:00                 ` Tom Moran
1998-09-28  0:00                   ` dewarr
1998-09-28  0:00                     ` Tom Moran
1998-09-28  0:00                       ` Tom Moran
1998-09-28  0:00                         ` Brian Rogoff
1998-09-28  0:00                       ` Pat Rogers
1998-09-28  0:00                         ` Tom Moran
1998-09-28  0:00                           ` Pat Rogers
1998-09-29  0:00                           ` dewarr
1998-09-29  0:00                             ` Tom Moran
1998-09-30  0:00                               ` Tom Moran
1998-10-01  0:00                                 ` dewar
1998-10-01  0:00                                   ` Tom Moran
1998-10-01  0:00                                     ` dewarr
1998-10-01  0:00                                       ` Tom Moran
1998-10-01  0:00                                     ` dewarr
1998-10-01  0:00                                     ` Samuel Tardieu
1998-10-01  0:00                                       ` Tom Moran
1998-10-01  0:00                                         ` dennison
1998-10-01  0:00                                         ` Tucker Taft
1998-10-01  0:00                                           ` Tom Moran
1998-10-02  0:00                                           ` dewarr
1998-10-02  0:00                                             ` Larry Kilgallen
1998-10-02  0:00                                               ` dewarr
1998-10-02  0:00                                           ` dennison
1998-10-02  0:00                                             ` dewarr
1998-10-02  0:00                                         ` dewarr
1998-10-09  0:00                                           ` Matthew Heaney
1998-10-09  0:00                                             ` dennison
1998-10-09  0:00                                               ` Matthew Heaney
1998-09-28  0:00                   ` dewarr
1998-09-28  0:00                     ` Richard D Riehle
1998-09-28  0:00                       ` Pat Rogers
1998-09-29  0:00                       ` dewarr
1998-10-09  0:00           ` Matthew Heaney
1998-10-09  0:00   ` Matthew Heaney
1998-09-26  0:00 ` Simon Wright
1998-10-09  0:00 ` Matthew Heaney
1998-10-09  0:00   ` Niklas Holsti
1998-10-10  0:00     ` Matthew Heaney
1998-10-11  0:00       ` Niklas Holsti
1998-10-11  0:00         ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
1998-09-25  0:00 bpr5549

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