comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: help with pointerproblem.
Date: 1998/09/17
Date: 1998-09-17T00:00:00+00:00	[thread overview]
Message-ID: <m34su75zgm.fsf@mheaney.ni.net> (raw)
In-Reply-To: 6tdhnq$3ig$1@nnrp1.dejanews.com

dewarr@my-dejanews.com writes:

> It is actually quite rare to point to a descriptor (I think
> that the RR compiler may have done this at least at one
> point).

Access objects designating unconstrained arrays in the VMS Ada compiler
(circa 1990) pointed to the descriptor, which pointed to the array
itself.

To get around this, bindings would be written to point to a large
constrained array, as in:

type Character_Array is 
  array (Natural range 0 .. 1_000_000) of Character;

type String is access Character_Array;
for String'Storage_Size use 0;

Obviously, you don't ever designate an actual array of that size, but
the representation of the access type matches that of the C code on the
other side.  It's up to the programmer to find the real end of the array
(usually by searching for the null character, or for whatever value
designates the end-of-array).

The SUN compiler I'm using now implements unconstrained array access
types using the thin pointer technique.




  reply	other threads:[~1998-09-17  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-10  0:00 help with pointerproblem Roger Carlsson
1998-09-10  0:00 ` Steve Doiel
1998-09-11  0:00   ` Wayne Magor
1998-09-11  0:00     ` Mats Weber
1998-09-12  0:00     ` dewarr
1998-09-17  0:00       ` Matthew Heaney [this message]
1998-09-11  0:00 ` Mats Weber
replies disabled

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