comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: 64bit access to an array of 8bit values
Date: 4 Mar 2002 02:29:49 -0800
Date: 2002-03-04T10:29:49+00:00	[thread overview]
Message-ID: <5ee5b646.0203040229.6ffc7ee3@posting.google.com> (raw)
In-Reply-To: 0CFB5EECF8614F8D.52C8F36A468D2F14.3AD3D533D2B72FDB@lp.airnews.net

"John R. Strohm" <strohm@airmail.net> wrote in message news:<0CFB5EECF8614F8D.52C8F36A468D2F14.3AD3D533D2B72FDB@lp.airnews.net>...

> The short answer is that you can't do what you want to 
> do.

short, but wrong :-)

> 
> The Ada compiler is not required to allocate precisely 
> one byte per array element, 

Well you can perfectly well use

  for x'component_size use 8;

to enforce that

> and it probably didn't.

Yes, of course it did
  
> Instead, it will probably allocate one
> "word" per array element,

No, of course it won't

> because word access is probably faster than byte
> access.

Not on any machine the questioner is likely to be using. 
This post sure had a lot of misinformation. Have not seen
yet whether there is anything useful in the rest of the
posts. The previous post about storage pools was even 
more irrelevant. The right answer of course is to use
unchecked conversion, and you can quite easily do what
you want. There is nothing wrong with pointer conversion
when it makes sense.



  parent reply	other threads:[~2002-03-04 10:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-03 14:58 64bit access to an array of 8bit values Dave Poirier
2002-03-03 15:38 ` Jim Rogers
2002-03-03 18:02 ` John R. Strohm
2002-03-03 16:39   ` Dave Poirier
2002-03-03 17:27   ` Jeffrey Creem
2002-03-05 20:49     ` John R. Strohm
2002-03-05 23:52       ` Jeffrey Creem
2002-03-06  7:30         ` John R. Strohm
2002-03-06 11:50           ` Jeffrey Creem
2002-03-07 20:03             ` John R. Strohm
2002-03-04 10:29   ` Robert Dewar [this message]
2002-03-04 13:02     ` Larry Kilgallen
2002-03-04 13:41       ` Dave Poirier
2002-03-03 22:24 ` David C. Hoos, Sr.
2002-03-03 22:51   ` Dave Poirier
2002-03-04  2:40     ` David C. Hoos, Sr.
2002-03-04  4:08     ` David Starner
2002-03-04 10:31   ` Robert Dewar
2002-03-04 18:00   ` Warren W. Gay VE3WWG
2002-03-04  3:15 ` Pat Rogers
2002-03-04  7:23 ` Jeffrey Carter
replies disabled

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