[Pharo-project] Fwd: Status of Alien FFI

Stéphane Ducasse stephane.ducasse at inria.fr
Thu Sep 17 02:39:24 EDT 2009


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


Begin forwarded message:

> From: Eliot Miranda <eliot.miranda at gmail.com>
> Date: September 17, 2009 12:17:13 AM CEDT
> To: Stéphane Ducasse <stephane.ducasse at inria.fr>
> Subject: Re: [Pharo-project] Status of Alien FFI
>
>
> what should I do?
>
> On Wed, Sep 16, 2009 at 3:09 PM, <pharo-project-owner at lists.gforge.inria.fr 
> > 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
> pharo-project-owner at lists.gforge.inria.fr.
>
>
>
> ---------- Forwarded message ----------
> From: Eliot Miranda <eliot.miranda at gmail.com>
> To: Ken Treis <ken at miriamtech.com>
> 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 <ken at miriamtech.com>  
> 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.
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20090917/1953f76b/attachment-0001.html>


More information about the Pharo-dev mailing list