comp.lang.ada
 help / color / mirror / Atom feed
* GNAT's internal format for Discriminant Records?
@ 1998-06-19  0:00 Rick Flower
  1998-06-19  0:00 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rick Flower @ 1998-06-19  0:00 UTC (permalink / raw)



We're trying to do some fixed format record layouts and are
looking into using discriminants.. These record formats will be
used to send data to hardware boxes, so the overhead of
what Ada might add when using some of the slick OO features
of the language are being checked into.  Now, we've already
found that GNAT (3.10p under Solaris 2.6) adds the size of the
discriminant to the overall record size (i.e. if the discriminant is
4 bits, then 4 bits are added to the overall record size).  We
tried the same under GHS Adamulti (1.8.8D) and found that it
did NOT add that overhead.  Now, for a few reasons, it would
appear that if there are multiple platforms/compilers involved
perhaps the use of discriminants should be avoided -- am I
correct in this theory?

My reasons are listed below :

    o Portability amongst different compilers/targets
    o Fixed format record layouts that MUST not have any other
       "information", OR it must be stripped off due to these
       records being sent to hardware boxes.

We've also looked at Tagged-Types and found that GNAT
(and AdaMulti for that matter) puts a 32-bit word at the front
of a record for a tagged type and that it can be removed using some simple
address arithmetic.

Any ideas/comments on this subject would be appreciated!

Thanks!

-- Rick








^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-06-21  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-19  0:00 GNAT's internal format for Discriminant Records? Rick Flower
1998-06-19  0:00 ` Simon Wright
1998-06-20  0:00 ` Tom Moran
1998-06-21  0:00   ` Robert Dewar
1998-06-21  0:00 ` Robert Dewar

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