Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear diary, on Wed, Jul 26, 2006 at 03:42:44AM CEST, I got a letter
where Junio C Hamano <junkio@xxxxxxx> said that...
> Petr Baudis <pasky@xxxxxxx> writes:
> 
> > diff --git a/perl/private-Error.pm b/perl/private-Error.pm
> > index ebd0749..8fff866 100644
> > --- a/perl/private-Error.pm
> > +++ b/perl/private-Error.pm
> > @@ -290,6 +288,14 @@ use vars qw(@EXPORT_OK @ISA %EXPORT_TAGS
> >  
> >  @ISA = qw(Exporter);
> >  
> > +
> > +sub blessed {
> > +	my $item = shift;
> > +	local $@; # don't kill an outer $@
> > +	ref $item and eval { $item->can('can') };
> > +}
> 
> Hmmm.  I wonder how this relates to what Merlyn actually said?
> 
>         From: merlyn@xxxxxxxxxxxxxx (Randal L. Schwartz)
>         Subject: Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
>         Date: 10 Jul 2006 18:42:35 -0700
>         Message-ID: <863bd8nchg.fsf@xxxxxxxxxxxxxxxxxxx>
>         Cc: Junio C Hamano <junkio@xxxxxxx>, <git@xxxxxxxxxxxxxxx>
>         To: Petr Baudis <pasky@xxxxxxx>
> 
>         >>>>> "Randal" == Randal L Schwartz <merlyn@xxxxxxxxxxxxxx> writes:
>         Randal> sub blessed {
>         Randal> my $item = shift;
>         Randal> local $@; # don't kill an outer $@
>         Randal> ref $item and eval { $item->can('can') };
>         Randal> }
> 
>         Randal> Oops, lose the local $@ line.  Just found out this is a
>         Randal> broken thing in current Perls.  The rest is good though.
> 
>         And thirdly, ignore what I *just* said, and concentrate on what
>         I *previously* said, becaused my testing was off.
> 
> My reading is that (1) the part of the patch should read
> something like this:
> 
>         sub blessed {
>                 my $item = shift;
>                 ref $item and eval { $item->can('can') };
>         }

I don't know, from my late-night understanding it should have the local
line... :-)

> and (2) Merlyn thinks there is a bigger problem than using Scalar::Util
> which should be dealt with first.  Was the use of try{}catch{}
> syntax sugar (and it is easy to leak memory) the issue?  How was
> that resolved?

We never got to producing anything that could trigger the memleak, at
least I wasn't able to reproduce it based on the rather vague
description.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]