comp.lang.ada
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
Subject: Re: Packing Record Structures in Ada
Date: 1998/01/13
Date: 1998-01-13T00:00:00+00:00	[thread overview]
Message-ID: <m267no4ccx.fsf@wf-rch.cirr.com> (raw)
In-Reply-To: dewar.884697551@merv


dewar@merv.cs.nyu.edu (Robert Dewar) writes:
> 
> THe stream facility in Ada 95 is one of its very powerful features. I have
> the impression that a lot of Ada 95 programmers are not sufficiently aware
> of this very important capability, and its wide applicability to solving
> problems of this nature, either through explicit use, or implicit use via
> the distribution annex.
> 

From my reading of the ARM, it is not extremely clear to me that
streaming between different compilers is 100% compatible.  It may be
(I haven't read the AARM and I'm no language expert) and I would
expect it would be in general (assuming endian-ness conversion is
done, of course).

I have done tests of streaming vs direct layout and copying using
GNAT.  Streaming is rather slow, on the order of 20 times slower than
direct copying.  I would expect this is due to a polymorphic call on
every data item (every array element, etc.), so I wouldn't expect any
other compilers to be any better.  With a representation clause,
layouts are guaranteed except for endianness, and you can directly
copy the data structure.

If you were able to do a "for T'Bit_Order use ..." would that solve
the endianness problem?  I realize that compilers do not have to allow
this, but if they did...

-- 
Corey Minyard               Internet:  minyard@acm.org
  Work: minyard@nortel.ca       UUCP:  minyard@wf-rch.cirr.com




  reply	other threads:[~1998-01-13  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-12  0:00 Packing Record Structures in Ada Randall_Rathbun
1998-01-12  0:00 ` Matthew Heaney
1998-01-13  0:00 ` Robert Dewar
1998-01-13  0:00   ` Corey Minyard [this message]
1998-01-13  0:00     ` Robert Dewar
1998-01-15  0:00     ` Michael F Brenner
1998-01-15  0:00       ` Robert Dewar
1998-01-19  0:00 ` Anonymous
replies disabled

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