in reply to Re^2: Inline C: using stderr segfaults?
in thread Inline C: using stderr segfaults?
The only explanation I can find to that code is that
returns a function pointer, and the next parenthesized expresion,(*Perl_IStdIO_ptr(((PerlInterpreter *)Perl_get_context())))->pStderr
are the arguments for calling that function.((*Perl_IStdIO_ptr((( PerlInterpreter* ) Perl_get_context()))))
It's no wonder function calls are slow in perl. Some single lines of XS code end up calling Perl_get_context() 7 or 8 times. There has to be a better way
Well, yes, there is a better way!... at least for XS, I don't know about Inline::C, though probably not.
You have to start your XS files defining the macro ...
... and then pass the Perl context manually from function to function using pTHX, aTHX, pTHX_ and aTHX_. See perlguts for the details.#define PERL_NO_GET_CONTEXT 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Inline C: using stderr segfaults?
by BrowserUk (Patriarch) on Nov 06, 2007 at 12:07 UTC | |
|
Re^4: Inline C: using stderr segfaults?
by syphilis (Archbishop) on Nov 06, 2007 at 07:06 UTC |