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
In reply to Re^3: Inline C: using stderr segfaults?
by salva
in thread Inline C: using stderr segfaults?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |