comp.lang.ada
 help / color / mirror / Atom feed
From: "Steven Deller" <deller@smsail.com>
Subject: RE: Exchanging objects between programs with different inheritance hierarchies
Date: Wed, 13 Nov 2002 17:17:43 -0600
Date: 2002-11-13T17:17:43-06:00	[thread overview]
Message-ID: <mailman.1037229362.26433.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <wccof8tfhwb.fsf@shell01.TheWorld.com>

> > Steven Deller wrote:
> >...  Using unchecked_conversion depends
> > > on the tags being integral to the
> > > record structures.  On GNAT they are not, so the code fails.
> 
> Is this really true?  I thought all Ada compilers store the 
> tag field as a field in the record (although not always at 
> the same offset)?  What is GNAT doing that messes up your 
> unchecked conversions?
> 
> Maybe I'm missing your point.
> 
> - Bob

I looked at the generated code.  For the tag comparison it was
generating 3 dereferences for an access type and 2 dereferences for an
object.  It appears the single tag word in the record is actually a
pointer to structure with a pointer to the actual value.  In different
programs, those pointers are to different locations, so just uchecked
converting to the unchecked, saved 32-bit value in the original record
does not work.

For Apex, the tag comparison was a simple value comparison and, since it
seemed to work across programs, apparently that value is not a pointer.

Regards,
Steve




  reply	other threads:[~2002-11-13 23:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3DC93287.2EA290F0@myob.com>
2002-11-13  2:19 ` Exchanging objects between programs with different inheritance hierarchies Steven Deller
2002-11-13  6:05   ` Jim Rogers
2002-11-13 15:54     ` Simon Wright
2002-11-13 17:44       ` tmoran
2002-11-14  6:29         ` Simon Wright
2002-11-13 17:59   ` Jeffrey Carter
2002-11-13 18:23     ` Robert A Duff
2002-11-13 23:17       ` Steven Deller [this message]
2002-11-13 12:18 Grein, Christoph
     [not found] <200211131218.NAA13957@bulgaria.otn.eurocopter.de>
2002-11-13 17:22 ` Steven Deller
2002-11-13 18:12   ` Robert A Duff
replies disabled

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