dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] CVMWord union and ReadLong Int32/Int64 mismatch?


From: Peter Colson
Subject: Re: [Pnet-developers] CVMWord union and ReadLong Int32/Int64 mismatch?
Date: Fri, 24 Sep 2004 14:00:58 +1000

On 24/09/2004, at 11:30 AM, Rhys Weatherley wrote:

On Friday 24 September 2004 11:18 am, Peter Colson wrote:
In cvm.c, the function 'ReadLong' (where long presumably means an
integral type) is assumed to be an Int64
taken from the same union above that only contains Int32 integrals:

Int64 quantities may occupy 1 or 2 stack words, depending upon the platform size/alignment rules. Adding a "ILInt64" field to the CVMWord union would cause stack slots to expand to 64 bits on all platforms, wasting space on
those (like x86) that don't need 64-bit alignment of 64-bit values.

The "IL_BEST_ALIGNMENT" macro will normally pad the union to the correct
boundary to prevent mis-aligned accesses on picky platforms.

I don't understand the Int32/Int64 mismatch here?

The "ReadLong" function is not taking a pointer to 1 stack word. It is taking a pointer to the stack word containing the beginning of the value. The value
may extend into the following stack words on some platforms.

OK that makes sense.

P.S. Wouldn't it be easier to simply migrate your customers off the
bletcherous AS/400 onto a real hardware platform and operating system? :-)

Not my customers, so not my call. I'm just trying to see if there's a future porting pnet to an AS/400 platform that now allows for 8 byte pointers that
can be bit manipulated (but provides 4 byte longs).

Regards,
Peter Colson.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]