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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1054df2e2c490eda X-Google-Attributes: gid103376,public From: Hannes Haug Subject: Re: Q: Memory management Date: 1996/06/27 Message-ID: #1/1 X-Deja-AN: 162329156 sender: haugha@chaq.informatik.uni-tuebingen.de references: <9606241936.AA11042@most> organization: Uni Tuebingen newsgroups: comp.lang.ada Date: 1996-06-27T00:00:00+00:00 List-Id: I'm posting this for W. Wesley Groleau. His link is broken. ---------- Forwarded message ---------- Date: Wed, 26 Jun 96 16:42:13 EST From: W. Wesley Groleau To: hannes.haug@student.uni-tuebingen.de Cc: wwgrol@pseserv3.fw.hac.com Subject: Re: Q: memory management (fwd) My link to comp.lang.ada is broken. Would you mind (re)posting this? Wes> X'Address and X(X'First)'Address should be identical, too, Is this true if you deal with unconstrained arrays ? The bounds have to be stored at the beginning of the array. I think that X'Address would give you the address of the location where the bounds are stored. LRM 13.3 (14) ADVISES that 'Address point to the array, not to the bounds. But (OUCH!) it does not require it. In LRM-83, 13.7.2 is not clear. Ouch! So, Hannes, to be safe, I guess you must assume that X'Address and X(X'First)'Address are NOT identical! But on the other point: The LRM requires that the bounds checks happen, which implies that the bounds exist, but it doesn't specify how. Some possibilities: the pointer points to the bounds and the actual array is immediately afterward. (Verdix) the pointer points to the actual array and the bounds are immediately before (Alsys compiler) the pointer points to an invisible record containing the bounds and the address of the actual array the pointer IS such a record in the current stack frame the pointer contains the address of the bounds AND of the array the pointer is an index to one or more arrays containing whatever is needed. the pointer is a long or short address (according to what?) that somehow enables access (gnat on Solaris) The CPU has so many registers that the compiler is able to keep the array bounds in registers in some subprograms. the compiler symbol table is embedded in the executable, updated at run time, and used to check the bounds. a custom hardware ESP chip is used to pluck the bounds directly from the Akashic Records where they were automatically recorded as a side-effect of the programmer's mental activity. (I didn't say they were all practical.) Also, I could be wrong, but I think that there are compilers that handle the bounds of constrained arrays the same way as unconstrained. --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Magnavox - Mail Stop 10-40 Home: 219-471-7206 Fort Wayne, IN 46808 elm (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------