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

Re: Freeing code

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
January 28, 2003 01:07
Subject:
Re: Freeing code
Message ID:
20030128100720.142a20a1.rgarciasuarez@free.fr
Dave Mitchell wrote:
> 
> It turns out that one in every 64K ops will not be freed, due to the
> following:
> 
>     Perl_op_free(pTHX_ OP *o)
>     {
> 	register OP *kid, *nextkid;
> 	OPCODE type;
> 
> 	if (!o || o->op_seq == (U16)-1)
> 	    return;
> 
> 
> The "o->op_seq == (U16)-1" condition was added somewhere between 5.003_22
> and 5.004_05, and I have no idea what it's for.
> 
> op_seq seems to get set from PL_op_seqmax, which only seems to get
> incremented in Perl_peep, and which of course soon wraps round in the
> presence of evals in a loop.

op_seq seems to be used only as a flag : "has this OP been optimized by now"

> Removing the -1 condition doesn't cause any obvious test failures.

Moreover, turning op_seq from a counter into a boolean flag doesn't cause
any test failure either (except for B::Concise of course, that uses
the value of op_seq in its output). op_seq is not related to cop_seq,
and I suspect it's obsolete.

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