Eliot,

I have a lot of FFI code already written, so I am hoping to drop Alien 
callbacks into FFI, and a structure is being a real pain.  I'll try you 
suggestion below, and then maybe alter the struct definition to contain 
integers vs. a pointer, into which FFI is making *certain* that I put only 
external addresses.

After moving to 1.3, I had to tweak some things where I originally passed null 
pointers, and now integers appear to be required :(  Similar forces might be at 
work here.  CogVM, Ubuntu Lucid.

Thanks!

Bill



________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[pharo-project-boun...@lists.gforge.inria.fr] on behalf of Eliot Miranda 
[eliot.mira...@gmail.com]
Sent: Wednesday, March 21, 2012 8:18 PM
To: Pharo-project@lists.gforge.inria.fr
Subject: Re: [Pharo-project] Alien callback thunk as ExternalAddress?



On Wed, Mar 21, 2012 at 4:01 PM, Schwab,Wilhelm K 
<bsch...@anest.ufl.edu<mailto:bsch...@anest.ufl.edu>> wrote:
I am getting near to jumping off the callback cliff.  My problem is that I have 
a generated external structure that expects a void pointer (actually a function 
pointer).  The setter sends #getHandle.  I tried to hot-wire that by defining 
CallbackThunk>>getHandle to answer the #address.

But FFICallbackThunk already implements address (inherited from Alien).  Why 
getHandle?


Is there a way to get an ExternalAddress that points to the thunk?  Should I 
even be asking this question? :)

I *think* it should be
    ExternalAddress new fromInteger: anFFICallbackThunk address


Bill






--
best,
Eliot

Reply via email to