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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ebb3574ca8067275 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-28 08:44:34 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!swiss.ans.net!solaris.cc.vt.edu!news.mathworks.com!news.kei.com!world!news.bu.edu!inmet!spock!stt From: stt@spock.camb.inmet.com (Tucker Taft) Subject: Re: Access type representations. Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <9410281131.AA15384@eurocontrol.de> Date: Fri, 28 Oct 1994 13:36:25 GMT Date: 1994-10-28T13:36:25+00:00 List-Id: In article <9410281131.AA15384@eurocontrol.de>, Bob Wells #402 wrote: >G'day, >Getting back to that thread of using access types to interface with >pointers in C, David emery said that my assumption that the access >type in Ada does not necessarily have to contain the address. > >My question is are there compilers out there that do *not* use the >address within the access type for the representation of the allocated >object? If there are, what do they use? There are three basic alternatives to addresses: 1) the "offset" part of a segmented address; This makes sense on the old X86 architecture, where the full address requires two registers, but one could decide to put all heap data into a single segment. 2) offsets relative to the beginning of the heap; This is similar to (1), but doesn't depend on the hardware having a segmented architecture. 3) indices into a heap of same-sized objects. This is similar to (2), except that it reduces the number of bits needed for an access value even further by dividing the offset by the number of bytes per object. (1) and (2) work when the heap is contiguous and of some limited size, e.g. when the 'Storage_Size attribute is specified for the access type. I don't know how many compilers use the above alternatives. I know some RR compilers used to use (1), and some Rational compilers used to use (2) or (3). >Thanks, >Bob W. (-: -Tucker Taft stt@inmet.com Intermetrics, Inc.