in reply to Re^17: Perl crash during perl_clone
in thread Perl crash during perl_clone
I had tried, but the SWIG typemaps I have currently did not allow the 'modulename:subname' format to register the callbacks.
I don't understand this. The SWIG stuff wraps the registering of the CCB, not the PCB.
So you "register" the PCB--by storing the SV* you pass into your code. You then call that stored SV* (using call_sv()) when the SWIG stuff calls back you CCB.
I agree that call_sv() should handle coderefs (according to the documentation; I even think I've done it in the past on 5.8x era perls), but every time I've tried it recently, it falls in a heap with coderefs (with or without threads involved), and works as advertised with a function name. So I stick with the latter. It does mean you have to name the callbacks rather than use anonymous subs or blocks, but that is an acceptable limitation (for me).
I having trouble understanding why you cannot do the same?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^19: Perl crash during perl_clone
by perlmonk1729 (Acolyte) on Nov 08, 2010 at 18:07 UTC | |
by BrowserUk (Patriarch) on Nov 08, 2010 at 19:21 UTC | |
by perlmonk1729 (Acolyte) on Nov 09, 2010 at 04:49 UTC | |
by BrowserUk (Patriarch) on Nov 09, 2010 at 06:59 UTC | |
by perlmonk1729 (Acolyte) on Nov 09, 2010 at 11:17 UTC | |
|