From: Nicholas Clark Date: Tue, 27 Dec 2005 17:24:11 +0000 (+0000) Subject: As what we're doing is generating subroutines, which are methods, we X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1234d8e95fb69a46c5f20bacb0c0cd2f1c325f7;p=p5sagit%2Fp5-mst-13.2.git As what we're doing is generating subroutines, which are methods, we need to invalidate cached methods. For constant.pm we need to create &Internals::inc_sub_generation p4raw-id: //depot/perl@26502 --- diff --git a/lib/ExtUtils/Constant/ProxySubs.pm b/lib/ExtUtils/Constant/ProxySubs.pm index 921da9a..4317e1e 100644 --- a/lib/ExtUtils/Constant/ProxySubs.pm +++ b/lib/ExtUtils/Constant/ProxySubs.pm @@ -338,6 +338,9 @@ EOBOOT } print $xs_fh <{$name} = \$scalar; + Internals::inc_sub_generation; } else { if(!exists $symtab->{$name}) { print STDERR "$name $scalar\n"; diff --git a/universal.c b/universal.c index 24aa3b8..5c147b6 100644 --- a/universal.c +++ b/universal.c @@ -199,6 +199,7 @@ XS(XS_Regexp_DESTROY); XS(XS_Internals_hash_seed); XS(XS_Internals_rehash_seed); XS(XS_Internals_HvREHASH); +XS(XS_Internals_inc_sub_generation); void Perl_boot_core_UNIVERSAL(pTHX) @@ -247,6 +248,8 @@ Perl_boot_core_UNIVERSAL(pTHX) newXSproto("Internals::hash_seed",XS_Internals_hash_seed, file, ""); newXSproto("Internals::rehash_seed",XS_Internals_rehash_seed, file, ""); newXSproto("Internals::HvREHASH", XS_Internals_HvREHASH, file, "\\%"); + newXSproto("Internals::inc_sub_generation",XS_Internals_inc_sub_generation, + file, ""); } @@ -949,6 +952,17 @@ XS(XS_Internals_HvREHASH) /* Subject to change */ Perl_croak(aTHX_ "Internals::HvREHASH $hashref"); } +XS(XS_Internals_inc_sub_generation) +{ + /* Using dXSARGS would also have dITEM and dSP, + * which define 2 unused local variables. */ + dAXMARK; + PERL_UNUSED_ARG(cv); + PERL_UNUSED_VAR(mark); + ++PL_sub_generation; + XSRETURN_EMPTY; +} + /* * Local variables: * c-indentation-style: bsd