comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: newbie Q: storage management
Date: 1997/05/04
Date: 1997-05-04T00:00:00+00:00	[thread overview]
Message-ID: <dewar.862774868@merv> (raw)
In-Reply-To: 336A0C55.2781@magellan.bgm.link.com


Sam said

<<> 1) Make sure the logic of your code avoids using dangling references.
> 2) If memory reclamation is important for your application, make sure that
>    the implementation supports it.
> 3) If your program is large or long-lived enough for memory leakage to be
>    a problem, make sure you deallocate objects when done with them.  (In
>    this case, (2) definitely applies.)>>

You really do not have to worry about 2). There has never been an Ada 83
or Ada 95 compiler that did not support unchecked deallocation for the global
heap, so there is nothng that you need to make sure of here. You can 
freely instantiate Unchecked_Deallocation on library level access types.

For access types at a local level, the situation has been less uniform.
Compilers with all the following behaviors have existsed:

1. All objects automatically freed on scope exit, explicit unchecked
   deallocation ignored.

2. All objects automatically freed on scope exit, but unchecked deallocation
   can be used to free them earlier.

3. No automatic free on scope exit, but unchecked deallocation works fine.

For examples, Alsys-386 (case 1)  Alsys-SPARC (case 2)  GNAT (case 3)

Of course in the GNAT case, we are are talking about default behavor,
since this is Ada 95, alternative storage pools can be specified to get
a behavior different from the default.





  reply	other threads:[~1997-05-04  0:00 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-29  0:00 newbie Q: storage management Kaz Kylheku
1997-04-30  0:00 ` Samuel A. Mize
1997-04-30  0:00   ` kaz
1997-04-30  0:00   ` Jon S Anthony
1997-05-02  0:00     ` Samuel A. Mize
1997-05-02  0:00       ` Jon S Anthony
1997-05-03  0:00       ` Robert Dewar
1997-05-05  0:00         ` Samuel A. Mize
1997-05-06  0:00           ` Robert Dewar
1997-05-06  0:00             ` Robert A Duff
1997-05-08  0:00               ` Jon S Anthony
1997-05-08  0:00                 ` John G. Volan
1997-05-09  0:00                   ` Jon S Anthony
1997-05-09  0:00                     ` John G. Volan
1997-05-13  0:00                       ` Jon S Anthony
1997-05-13  0:00                         ` Robert Dewar
1997-05-09  0:00                 ` Robert A Duff
1997-05-09  0:00                   ` Brian Rogoff
1997-05-10  0:00                     ` Robert A Duff
1997-05-09  0:00                   ` Jon S Anthony
1997-05-10  0:00                     ` Robert A Duff
1997-05-12  0:00                       ` Jon S Anthony
1997-05-10  0:00                   ` Robert Dewar
1997-05-09  0:00                 ` Robert Dewar
1997-05-13  0:00                   ` Jon S Anthony
1997-05-06  0:00           ` Michael F Brenner
1997-05-06  0:00             ` Assuaging sour grapes :-) [was: newbie Q: storage management] John G. Volan
1997-05-07  0:00               ` Stephen Posey
1997-05-07  0:00               ` Kevin Cline
1997-05-07  0:00                 ` John G. Volan
1997-05-07  0:00                   ` John G. Volan
1997-05-07  0:00                     ` Robert Dewar
1997-05-08  0:00                   ` Jon S Anthony
1997-05-08  0:00                 ` Jon S Anthony
1997-05-08  0:00               ` Dynamic binding of packages Nick Roberts
1997-05-08  0:00                 ` John G. Volan
1997-05-07  0:00             ` newbie Q: storage management Jeff Carter
1997-05-07  0:00             ` Robert Dewar
1997-05-09  0:00               ` Robert I. Eachus
1997-05-10  0:00                 ` Robert Dewar
1997-05-03  0:00       ` Robert Dewar
1997-05-03  0:00         ` Jon S Anthony
1997-05-04  0:00           ` Robert Dewar
1997-05-05  0:00         ` Samuel A. Mize
1997-05-04  0:00       ` Kevin Cline
1997-05-04  0:00         ` Robert Dewar
1997-05-02  0:00   ` Samuel A. Mize
1997-05-04  0:00     ` Robert Dewar [this message]
1997-04-30  0:00 ` Jon S Anthony
1997-05-02  0:00   ` Robert Dewar
1997-05-04  0:00     ` Kaz Kylheku
1997-05-04  0:00       ` Robert Dewar
1997-04-30  0:00 ` Marinus van der Lugt
1997-04-30  0:00   ` Jon S Anthony
1997-05-02  0:00     ` Robert Dewar
1997-04-30  0:00 ` Robert I. Eachus
1997-05-02  0:00 ` Nick Roberts
1997-05-03  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-05-08  0:00 Jon S Anthony
1997-05-09  0:00 ` Robert Dewar
1997-05-09  0:00   ` Robert A Duff
1997-05-10  0:00     ` Fergus Henderson
1997-05-10  0:00       ` Robert A Duff
1997-05-12  0:00       ` Jon S Anthony
1997-05-13  0:00         ` Robert Dewar
1997-05-10  0:00 ` Fergus Henderson
1997-05-10  0:00   ` Robert Dewar
1997-05-13  0:00   ` Jon S Anthony
replies disabled

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