XS callback function

2010-02-10 Thread Private and Confidential
I've written a callback function for an XS module designed to call a perl function when invoked. If I call the function directly, from within the C code, it runs through completely as expected. If its invoked as a callback from the library I am wrapping, it does immediately at "dSP;" i.e. SV

Re: XS callback function

2010-02-10 Thread muppet
On Feb 10, 2010, at 7:32 PM, Private and Confidential wrote: > I've written a callback function for an XS module designed to call a perl > function when invoked. > > If I call the function directly, from within the C code, it runs through > completely as expected. > > If its invoked as a call

Re: XS callback function

2010-02-10 Thread Private and Confidential
Confirmed, the library I am wrapping runs in a separate thread and runs its callbacks from there. "context" is a good keyword and led me to dTHX and PERL_SET_CONTEXT. I haven't found a good example of using these yet. Adding dTHX did get me past dSP, but I die consistently in ENTER now. On 2/1