Re: Memory management clarification



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).


Most Ada implementations do not support garbage collection, and with such implementations, your examples would simply create a lot of garbage.
.




Relevant Pages

  • C++0x and Threads - a poor relation to Adas tasking model?
    ... Obviously we all know that one of the big issues Ada compilers had in ... the early days was providing a supporting run-time system that was ... I believe there are many Ada implementations developed ... for bare machines where the Ada vendor provided the run time system. ...
    (comp.lang.ada)
  • Re: Address of an object
    ... Ada does not support. ... So you are trying to extend the Ada language. ... You define a pool which eventually takes its memory from some another ... The interface to this is a generic package, which provides a pointer ...
    (comp.lang.ada)
  • Re: OO languages
    ... The only data point I have first hand is from the late 80's. ... The first and only time I used Ada the toolset and development ... Yes, some/most of the early Ada implementations were horrible, ... and SW) centered around Pascal compilers. ...
    (comp.arch.embedded)
  • Re: put of access type
    ... implemented as a reference to some storage pool and an offset into ... I think the Ada 95 definition of storage pools would make this ... Offset: Integer; ...
    (comp.lang.ada)