From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_05,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!nrl-cmf!ukma!gatech!mcnc!rti!jb From: jb@rti.UUCP (Jeff Bartlett) Newsgroups: comp.lang.ada Subject: Re: Overlays Summary: pointer magic Keywords: overlay, equivalence, union Message-ID: <2459@rti.UUCP> Date: 16 Sep 88 22:49:51 GMT References: <3338@cs.utexas.edu> Organization: Research Triangle Institute, RTP, NC List-Id: 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 -