ken eliot is not in the pharo mailing-list so I repost it.


Begin forwarded message:

From: Eliot Miranda <[email protected]>
Date: September 17, 2009 12:17:13 AM CEDT
To: Stéphane Ducasse <[email protected]>
Subject: Re: [Pharo-project] Status of Alien FFI


what should I do?

On Wed, Sep 16, 2009 at 3:09 PM, <[email protected] > wrote:
You are not allowed to post to this mailing list, and your message has
been automatically rejected.  If you think that your messages are
being rejected in error, contact the mailing list owner at
[email protected].



---------- Forwarded message ----------
From: Eliot Miranda <[email protected]>
To: Ken Treis <[email protected]>
Date: Wed, 16 Sep 2009 15:09:43 -0700
Subject: Re: [Pharo-project] Status of Alien FFI
Hi Ken,

On Wed, Sep 16, 2009 at 12:17 PM, Ken Treis <[email protected]> wrote:

On Sep 16, 2009, at 12:02 PM, Douglas Brebner wrote:

One minor point is that whether integers and longs are different depends on the platforms data model. Under MS Win64, integers and long integers are both 32bit, while on most unixes integers are 32bit while long ints
are 64bit. (LLP64 and LP64 models respectively)

Really? so sizeof(int) == sizeof(long) and sizeof(long) ~= sizeof(__int64)?? Strange choice (see below) ;)
Every other 64bit platform I've seen has used
    sizeof(int) == 4, sizeof(long) == sizeof(long long)

But one should insulate oneself using appropriate defines/typedefs, and include asserts to confirm basic types are of the size one assumes.

I don't know if this is important though.

Good point. All of my platforms are LP64 (Mac OS X and Linux x86-64), and my main objective at present is to get this working for an application I'm committed to build, so I was ignoring those sorts of cross-platform details.

Perhaps there would need to be new primitives for the basic size of each relevant C type? I'm anxious to hear what Eliot might have to say about this since he's got about 2000x more experience with this than I do.

are you using the 64-bit VM? If you're using a 32-bit VM on a 64- bit platform then yu're using 32-bits and you'll be linking against 32-bit libraries and hence nothing will have changed.

Alien has support for 64-bit values. Of course it uses the Windows choice, short = 2, int unused as a name, long = 4, longLong = 8. e.g.
    anAlien unsignedByteAt: oneRelativeIndex
    anAlien unsignedShortAt: oneRelativeIndex
    anAlien unsignedLongAt: oneRelativeIndex
    anAlien unsignedLongLongAt: oneRelativeIndex
are the basic primitives for fetching unsigned integers.

But this needs to be wrapped with something that selects the right sizes based on the current platform and that's yet to be addressed.




--
Ken Treis
Miriam Technologies, Inc.





_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to