From: Rafael Garcia-Suarez Date: Tue, 9 Sep 2003 01:44:24 +0000 (+0200) Subject: One more chance... Elizabeth's change #21107 plus X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8becbb3b066adee4495175867634bdba48ae2c5d;p=p5sagit%2Fp5-mst-13.2.git One more chance... Elizabeth's change #21107 plus Subject: Re: [PATCH] warnings.pl: each thread 10K smaller Message-Id: <20030909014424.7ef5e0cd.rgarciasuarez@free.fr> p4raw-link: @21107 on //depot/perl: 71a1411e8309f445a8e3afde57ce393886ff905f p4raw-id: //depot/perl@21136 --- diff --git a/lib/warnings.pm b/lib/warnings.pm index 705548a..edbe1a7 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -6,7 +6,7 @@ package warnings; -our $VERSION = '1.02'; +our $VERSION = '1.03'; =head1 NAME @@ -131,9 +131,9 @@ See L and L. =cut -use Carp ; +use Carp (); -%Offsets = ( +our %Offsets : unique = ( # Warnings Categories added in Perl 5.008 @@ -190,7 +190,7 @@ use Carp ; 'assertions' => 94, ); -%Bits = ( +our %Bits : unique = ( 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..47] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [29] 'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [47] @@ -241,7 +241,7 @@ use Carp ; 'y2k' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [46] ); -%DeadBits = ( +our %DeadBits : unique = ( 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..47] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [29] 'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [47] @@ -301,7 +301,7 @@ $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ; sub Croaker { delete $Carp::CarpInternal{'warnings'}; - croak(@_); + Carp::croak(@_); } sub bits @@ -470,10 +470,10 @@ sub warn my $message = pop ; my ($callers_bitmask, $offset, $i) = __chk(@_) ; - croak($message) + Carp::croak($message) if vec($callers_bitmask, $offset+1, 1) || vec($callers_bitmask, $Offsets{'all'}+1, 1) ; - carp($message) ; + Carp::carp($message) ; } sub warnif @@ -489,11 +489,11 @@ sub warnif (vec($callers_bitmask, $offset, 1) || vec($callers_bitmask, $Offsets{'all'}, 1)) ; - croak($message) + Carp::croak($message) if vec($callers_bitmask, $offset+1, 1) || vec($callers_bitmask, $Offsets{'all'}+1, 1) ; - carp($message) ; + Carp::carp($message) ; } 1; diff --git a/toke.c b/toke.c index aef667e..c19ee09 100644 --- a/toke.c +++ b/toke.c @@ -3036,10 +3036,12 @@ Perl_yylex(pTHX) CvMETHOD_on(PL_compcv); else if (!PL_in_my && len == 9 && strnEQ(s, "assertion", len)) CvASSERTION_on(PL_compcv); -#ifdef USE_ITHREADS else if (PL_in_my == KEY_our && len == 6 && strnEQ(s, "unique", len)) +#ifdef USE_ITHREADS GvUNIQUE_on(cGVOPx_gv(yylval.opval)); +#else + ; /* skip that case to avoid loading attributes.pm */ #endif /* After we've set the flags, it could be argued that we don't need to do the attributes.pm-based setting diff --git a/warnings.pl b/warnings.pl index eff8d60..6177952 100644 --- a/warnings.pl +++ b/warnings.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -$VERSION = '1.01'; +$VERSION = '1.02'; BEGIN { push @INC, './lib'; @@ -414,7 +414,7 @@ while () { #$list{'all'} = [ $offset .. 8 * ($warn_size/2) - 1 ] ; $last_ver = 0; -print PM "%Offsets = (\n" ; +print PM "our %Offsets : unique = (\n" ; foreach my $k (sort { $a <=> $b } keys %ValueToName) { my ($name, $version) = @{ $ValueToName{$k} }; $name = lc $name; @@ -430,7 +430,7 @@ foreach my $k (sort { $a <=> $b } keys %ValueToName) { print PM " );\n\n" ; -print PM "%Bits = (\n" ; +print PM "our %Bits : unique = (\n" ; foreach $k (sort keys %list) { my $v = $list{$k} ; @@ -444,7 +444,7 @@ foreach $k (sort keys %list) { print PM " );\n\n" ; -print PM "%DeadBits = (\n" ; +print PM "our %DeadBits : unique = (\n" ; foreach $k (sort keys %list) { my $v = $list{$k} ; @@ -475,7 +475,7 @@ __END__ package warnings; -our $VERSION = '1.02'; +our $VERSION = '1.03'; =head1 NAME @@ -600,7 +600,7 @@ See L and L. =cut -use Carp ; +use Carp (); KEYWORDS @@ -609,7 +609,7 @@ $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ; sub Croaker { delete $Carp::CarpInternal{'warnings'}; - croak(@_); + Carp::croak(@_); } sub bits @@ -778,10 +778,10 @@ sub warn my $message = pop ; my ($callers_bitmask, $offset, $i) = __chk(@_) ; - croak($message) + Carp::croak($message) if vec($callers_bitmask, $offset+1, 1) || vec($callers_bitmask, $Offsets{'all'}+1, 1) ; - carp($message) ; + Carp::carp($message) ; } sub warnif @@ -797,11 +797,11 @@ sub warnif (vec($callers_bitmask, $offset, 1) || vec($callers_bitmask, $Offsets{'all'}, 1)) ; - croak($message) + Carp::croak($message) if vec($callers_bitmask, $offset+1, 1) || vec($callers_bitmask, $Offsets{'all'}+1, 1) ; - carp($message) ; + Carp::carp($message) ; } 1;