[comp.lang.ada] Overlays

fred@cs.utexas.edu (Fred Hosch) (09/16/88)

LRM 13.5 tells me "address clauses should not be used to achieve overlays
of objects."  How do I "achieve overlays" of --very large-- objects?

Fred. Hosch
fred@cs.utexas.edu

jb@rti.UUCP (Jeff Bartlett) (09/17/88)

In article <3338@cs.utexas.edu>, fred@cs.utexas.edu (Fred Hosch) writes:
> LRM 13.5 tells me "address clauses should not be used to achieve overlays
> of objects."  How do I "achieve overlays" of --very large-- objects?
> 
> Fred. Hosch
> fred@cs.utexas.edu

It sounds like you are trying to save storage by sharing the space
of large objects with disjoint but static lifetimes.

One method is to declare pointers to the objects and allocate the object
at the beginning of its lifetime and dispose of it at the end of its lifetime.

Also, one could use renaming to avoid all of the "PTR.ALL" references.

To get equivalencing, use UNCHECKED_CONVERSION between the pointers. (I think
it takes access types).


Jeff Bartlett
Center for Digital Systems Research
Research Triangle Institute		jb@rti.rti.org		mcnc!rti!jb
-