develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH B::Deparse] Make warnings handling more robust

Thread Previous | Thread Next
From:
Graham Barr
Date:
July 5, 2001 12:10
Subject:
Re: [PATCH B::Deparse] Make warnings handling more robust
Message ID:
20010705200916.Y52398@pobox.com
On Thu, Jul 05, 2001 at 03:06:26PM -0400, Ronald J Kimball wrote:
> On Thu, Jul 05, 2001 at 07:19:46PM +0100, Robin Houston wrote:
> > (An aside: I don't think it's really pessimised either; the () prototype
> > still causes perl to optimise away calls to the function.)
> 
> I believe function calls are optimized away only when they have a ()
> prototype *and* the body of the sub consists of returning a constant.  In
> your code, the sub returns a variable, so calls won't be optimized away.

It will be optimized away, because there is nothing else that can reference the
variable. ie the sub is the only thing holding a reference count on the variable,
so we know it cannot be changed bu anything else

Graham.

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