[mercury-users] 64-bit ints on 32-bit platforms

Michael Day mikeday at yeslogic.com
Wed Oct 14 16:48:17 AEDT 2009


Hi,

What would be the best way to manipulate 64-bit integers on 32-bit 
platforms?

Presumably on 64-bit platforms one can just use the Mercury int type, 
but on 32-bit platforms it would be necessary to make a new type 
consisting of two 32-bit ints:

:- type int64 ---> int64(int, int).

Or use a foreign type:

:- pragma foreign_type(c, int64, "int64_t").

In each case, this will result in a 32-bit pointer to a 64-bit integer 
being passed to functions or stored in other structures, correct?

I guess what I'm getting at is that it doesn't seem possible to have a 
64-bit unboxed value in 32-bit Mercury code, unless the programmer 
explicitly stores and passes two 32-bit integers each time, which will 
break abstraction and be completely unnecessary on 64-bit platforms.

Is this correct?

Best regards,

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list