comp.lang.ada
 help / color / mirror / Atom feed
From: "Samuel T. Harris" <samuel_t_harris@Raytheon.com>
Subject: Re: Overlay allowability
Date: 2000/05/03
Date: 2000-05-03T00:00:00+00:00	[thread overview]
Message-ID: <3910514D.13BF2DE1@Raytheon.com> (raw)
In-Reply-To: 8eketr$i3c$1@nnrp1.deja.com

Ted Dennison wrote:
> 
> In article <390D94FB.D23390D4@lmco.com>,
>   "Marc A. Criley" <marc.a.criley@lmco.com> wrote:
> > A few times in my career I've encountered situations where two
> > different representations of the same set of bits are desired in a
> > high
> 
> > This has always struck me as somewhat iffy, but I confess I've used
> > it as well on a couple occasions with Ada 83.  I've always found that
> > it works as one intuitively expects, so long as all alignment, layout
> > and sizing aspects are fully thought through and accommodated.
> 
> In Ada 83 I believe doing that rendered your program erronious. In 95,
> I'm not sure, but its probably been reassigned to "bounded error" territory.
> 
> This is exactly what Unchecked_Conversion was put in the language for.
> If performance prohibits copying the whole structure, you can always
> perform unchecked conversion on an access type that points to your
> structure (even SMART allowed this).
> 

Many times the need for such overlays is a continual need
throughout a section of code. Several calls to unchecked_conversion
is simply to slow and does present a consistency problem
associated with having two separate objects instead of two
overlayed objects. This consistency problem can be exploited
in a tasking environment and cause unpredictable results.

So, when performance and consistency are the requirements,
make an overlay. If one simply needs to jam one kind of data
into another, use unchecked_conversion.

-- 
Samuel T. Harris, Principal Engineer
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"




  reply	other threads:[~2000-05-03  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-01  0:00 Overlay allowability Marc A. Criley
2000-05-01  0:00 ` tmoran
2000-05-01  0:00 ` Tucker Taft
2000-05-01  0:00   ` Keith Thompson
2000-05-08  0:00     ` Tucker Taft
2000-05-01  0:00   ` mark_biggar
2000-05-03  0:00   ` Robert I. Eachus
2000-05-01  0:00 ` Ted Dennison
2000-05-03  0:00   ` Samuel T. Harris [this message]
2000-05-03  0:00     ` Robert A Duff
2000-05-03  0:00     ` Ted Dennison
2000-05-04  0:00     ` Robert Dewar
2000-05-08  0:00       ` Samuel T. Harris
2000-05-08  0:00         ` Robert Dewar
2000-05-09  0:00           ` Samuel T. Harris
2000-05-09  0:00             ` Ted Dennison
2000-05-10  0:00               ` Marc A. Criley
2000-05-11  0:00                 ` tmoran
2000-05-12  0:00                   ` tmoran
2000-05-02  0:00 ` Robert I. Eachus
2000-05-03  0:00   ` Marc A. Criley
replies disabled

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