comp.lang.ada
 help / color / mirror / Atom feed
From: Hannes Haug <Hannes.Haug@Student.Uni-Tuebingen.de>
Subject: Re: Q: Memory management
Date: 1996/06/27
Date: 1996-06-27T00:00:00+00:00	[thread overview]
Message-ID: <uvv20j13cs6.fsf@chaq.informatik.uni-tuebingen.de> (raw)
In-Reply-To: 9606241936.AA11042@most

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 <wwgrol@pseserv3.fw.hac.com>
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
---------------------------------------------------------------------------




  parent reply	other threads:[~1996-06-27  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-24  0:00 Q: Memory management W. Wesley Groleau (Wes)
1996-06-25  0:00 ` Hannes Haug
1996-06-25  0:00   ` Robert A Duff
1996-06-25  0:00   ` Tucker Taft
     [not found]     ` <Dtzv4J.9FL@thomsoft.com>
1996-07-17  0:00       ` Robert Dewar
1996-06-25  0:00 ` Jon S Anthony
1996-06-26  0:00   ` Robert Dewar
1996-06-27  0:00 ` Hannes Haug [this message]
     [not found] <JSA.96Jun26142033@organon.com>
1996-06-27  0:00 ` Hannes Haug
1996-06-27  0:00   ` Robert A Duff
1996-06-27  0:00 ` Hannes Haug
  -- strict thread matches above, loose matches on Subject: below --
1996-06-19  0:00 Q: memory management W. Wesley Groleau (Wes)
1996-06-20  0:00 ` Hannes Haug
1996-06-20  0:00 ` Hannes Haug
1996-06-20  0:00   ` Robert Dewar
1996-06-21  0:00 ` Hannes Haug
1996-06-21  0:00   ` Robert Dewar
1996-06-25  0:00 ` Hannes Haug
1996-06-15  0:00 Hannes Haug
1996-06-15  0:00 ` Jon S Anthony
1996-06-16  0:00   ` Robert Dewar
1996-06-18  0:00   ` Kent Mitchell
1996-06-15  0:00 ` Robert Dewar
1996-06-16  0:00 ` Hannes Haug
1996-06-17  0:00   ` Hannes Haug
1996-06-17  0:00   ` Tucker Taft
1996-06-18  0:00   ` Hannes Haug
1996-06-18  0:00     ` Tucker Taft
1996-06-19  0:00     ` Hannes Haug
1996-06-18  0:00 ` Jon S Anthony
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox