develooper Front page | perl.perl5.porters | Postings from October 2003

Re: perl's internal usage of dTHX; is a bad idea

Thread Previous | Thread Next
Stas Bekman
October 25, 2003 17:27
Re: perl's internal usage of dTHX; is a bad idea
Message ID:
Nick Ing-Simmons wrote:
> Stas Bekman <> writes:
>>Frankly I don't understand why internally Perl uses functions which aren't 
>>prototyped with (pTHX_ ...), and call dTHX; instead. 
> XS module API compatibility.

Yes, but I'm talking about internal calls (not XS) that have my_perl, but not 
passing it because the callee doesn't accept one (Perl_safesysmalloc is one of 

If all internall perl calls were never to use dTHX, PERL_SET_CONTEXT() won't 
be needed.

> Most of API _does_ pass aTHX (usually via a macro).
> An up-to-date list of those that don't would be welcome, there 
> may now be few enough to replicate those and lead XS writers in 
> that direction.

Anybody has an idea of doing this programmatically? Using a simple C code 
parser that returns all functions that call dTHX and its variants?

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About