This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add PERL_NO_GET_CONTEXT to xs template in h2xs.PL
authorDaniel Dragan <bulk88@hotmail.com>
Thu, 6 Dec 2012 04:39:44 +0000 (23:39 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 6 Dec 2012 05:31:42 +0000 (21:31 -0800)
An XS module not using PERL_NO_GET_CONTEXT is extremely inefficient under
threaded Perls. Prevent PERL_NO_GET_CONTEXT-less modules in the future
by making it a default. Many XS modules are created with h2xs.
Also see this anonymous complaint http://perlmonks.org/?node_id=990732 .

utils/h2xs.PL

index 6b2c78f..25bd0ec 100644 (file)
@@ -1386,6 +1386,7 @@ if( ! $opt_X ){ # print XS, unless it is disabled
 warn "Writing $ext$modpname/$modfname.xs\n";
 
 print XS <<"END";
+#define PERL_NO_GET_CONTEXT
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"