Re: Memory management clarification
- From: Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx>
- Date: 26 Jul 2005 10:21:18 -0400
"Frank J. Lhota" <NOSPAM.lhota@xxxxxxxxxxx> writes:
> Maciej Sobczak wrote:
> > Hi,
> > Trying to learn a bit of Ada I came across a statement that memory
> > allocated from the pool will be implicitly reclaimed when the acces
> > variable used to reference it goes out of scope.
>
> No, that is not true. What is true is that if an access type goes out of
> scope, then the data allocated from the pool for that type will be
> reclaimed. See ARM 13.11 (18).
That's not quite true, either. Most implementations use a global heap
by default, and never automatically reclaim memory. If you use a
Storage_Size clause on a local access type, then what you say is true.
But local access types are not very useful.
> Most Ada implementations do not support garbage collection, and with
> such implementations, your examples would simply create a lot of garbage.
Right.
- Bob
.
- Follow-Ups:
- Re: Memory management clarification
- From: Frank J. Lhota
- Re: Memory management clarification
- References:
- Memory management clarification
- From: Maciej Sobczak
- Re: Memory management clarification
- From: Frank J. Lhota
- Memory management clarification
- Prev by Date: Re: Memory management clarification
- Next by Date: Re: Memory management clarification
- Previous by thread: Re: Memory management clarification
- Next by thread: Re: Memory management clarification
- Index(es):
Relevant Pages
|