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

Re: Freeing code

Thread Previous | Thread Next
Dave Mitchell
January 27, 2003 17:01
Re: Freeing code
Message ID:
On Mon, Jan 27, 2003 at 10:38:40PM +0000, Dave Mitchell wrote:
> I see a similar very slow leak on the one-liner
>     eval '' while 1;
> Which increases in size by a page (4K) every 10-20 secs

P5Pers - I've confirmed that this is a real leak!

It turns out that one in every 64K ops will not be freed, due to the

    Perl_op_free(pTHX_ OP *o)
	register OP *kid, *nextkid;
	OPCODE type;

	if (!o || o->op_seq == (U16)-1)

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.

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

Ideas, anyone?



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About