[Pharo-project] Alien callback thunk as ExternalAddress?

Schwab,Wilhelm K bschwab at anest.ufl.edu
Wed Mar 21 20:27:02 EDT 2012


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-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] on behalf of Eliot Miranda [eliot.miranda at gmail.com]
Sent: Wednesday, March 21, 2012 8:18 PM
To: Pharo-project at 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 <bschwab at anest.ufl.edu<mailto:bschwab at 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

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


More information about the Pharo-dev mailing list