comp.lang.ada
 help / color / mirror / Atom feed
From: bpr5549@my-dejanews.com
Subject: Re: Freeing Pointers to classwide types
Date: 1998/09/25
Date: 1998-09-25T00:00:00+00:00	[thread overview]
Message-ID: <6uf355$ro8$1@nnrp1.dejanews.com> (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




             reply	other threads:[~1998-09-25  0:00 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-25  0:00 bpr5549 [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-09-24  0:00 Freeing Pointers to classwide types joecool
1998-09-25  0:00 ` Tom Moran
1998-09-25  0:00   ` Bob Fletcher
1998-09-25  0:00     ` dennison
1998-09-25  0:00     ` Samuel Tardieu
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                                     ` 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-10-01  0:00                                     ` dewarr
1998-10-01  0:00                                     ` dewarr
1998-10-01  0:00                                       ` Tom Moran
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-25  0:00 ` alan walkington
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
replies disabled

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