develooper Front page | perl.perl5.porters | Postings from January 2014

Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'

Thread Previous | Thread Next
From:
Zefram
Date:
January 27, 2014 16:26
Subject:
Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'
Message ID:
20140127162633.GC11936@fysh.org
Matthew Horsfall (alh) wrote:
>Which one do I actually need here?

They're different; which you need depends on the situation.  Putting
op_type into op_targ, as op_null() does, is preserving the original op
type for code walkers.  That's what gets you the "ex-" in front of op
types in B::Concise output.  That or manual nulling is for when an op
is being retained as part of the op tree but should be omitted from the
execution sequence.  op_free() actually deallocates an op structure,
and is the way to dispose of an op that has been edited out of the tree
as well as from the execution sequence.  cop_free() is mostly just a
type-specific version of op_free().

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About