comp.lang.ada
 help / color / mirror / Atom feed
From: holsti@cs.Helsinki.FI (Niklas Holsti)
Subject: Re: dynamic allocation
Date: 1995/04/04
Date: 1995-04-04T00:00:00+00:00	[thread overview]
Message-ID: <3lqhb3$e5h@hydra.Helsinki.FI> (raw)
In-Reply-To: 3loml4$98v@erinews.ericsson.se

In <3loml4$98v@erinews.ericsson.se> ehsjony@ehs.ericsson.se (Jonas Nygren) writes:


>Some short questions:

>Does Ada95 have dynamic memory allocation/deallocation primitives builtin
>to the language - cf. C++'s new and delete?

Yes, "new" and "unchecked_deallocation". Don't be scared by the name of
the latter, it's safer than the "delete" in C++. Ada 83 has these also.

>Does Ada95 have functionality comparable with C++'s constructors and
>destructors?

Yes, default initialization and finalization for Controlled types.
This is new with Ada 95.

>Does Ada95 support garbage collection?

Automatic garbage collection is allowed in both Ada 83 and Ada 95, but
no known compilers do it.  Both Ada 83 and 95 can collect the memory
used by dynamically allocated objects of a type when the type goes out
of scope.  So if in a subprogram you define a local type, the
dynamically allocated objects of that type may be collected when the
subprogram returns.  I think this is implementation dependent, however. 
Ada 95 gives you more control over the storage pools. 

>thanks in advance

>/jonas

Hope to have helped,
- Niklas

--
Niklas Holsti                         
    Space Systems Finland Ltd, phone +358 0 4354 3928
    Tekniikantie 12, P.O. Box 324, FIN-02151 Espoo, Finland




  parent reply	other threads:[~1995-04-04  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-03  0:00 dynamic allocation Jonas Nygren
1995-04-03  0:00 ` Samuel Tardieu
1995-04-04  0:00 ` Niklas Holsti [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-27 19:49 tmoran
replies disabled

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