I agree with the other answers (for the most part). Not much is guarenteed
about 'Address. But by-reference and aliased objects have to *work* like
they are not moved. If the runtime can deal with moving such things, Ada
doesn't care.
As a practical matter, most Ada implementations assume objects don't move.
Janus/Ada assigns everything at compile-time, so the only time anything
moves is when it is created or destroyed.
The big problem with garbage collection in Ada is that early finalization is
not allowed (other than a few tiny exceptions in failure cases and [in
post-Ada 22] certain function results.) So any object that might have a
controlled part can never be garbage collected, even if there is no other
use or access to it.
Changing that is a very hard problem, as you cannot allow finalization to
happen at any instant or by any arbitrary task (if you did, every
finalization would be a race scenario, and every Finalize routine would need
dedicated locking). I've suggesting allowing it for "unreachable objects"
(not a useful definition by itself, it would need to be defined) at places
where masters are being exited anyway (so finalization should be expected at
those locations). But it's unclear if you can build a useful garbage
collector that way (and what the overhead would be).
Randy.
"Niklas Holsti" <niklas...@tidorum.invalid> wrote in message
news:k94t2n...@mid.individual.net...