develooper Front page | perl.perl5.porters | Postings from April 2000

Re: [ID 20000409.003] Disappearing constant values

Thread Previous | Thread Next
From:
Gurusamy Sarathy
Date:
April 9, 2000 23:49
Subject:
Re: [ID 20000409.003] Disappearing constant values
Message ID:
200004100648.XAA24711@maul.ActiveState.com
On Sun, 09 Apr 2000 22:21:27 MDT, eric@xmission.com wrote:
>[excellent analysis snipped]
>
>These are the possibilities I see:
>
>  1. Have the tokenizer always create a new SV for constant subs.
>  2. Have peek copy the constant instead of using it directly when
>     it moves it to the pad.
>  3. Have pad_free never remove the flags when both SVs_PADTMP and
>     SVs_READONLY are set.
>  4. Have pad_free only remove the flags when the reference count
>     for the SV is 1.
>
>I lean towards 4 or 2.  I think that 4 would be safe but it might
>not always free up a pad slot when it should.  2 should also be
>safe but would cause additional memory usage.

I'd say peek() should make a copy when moving it to the pad if the
SV is already a PADTMP.

Thanks.


Sarathy
gsar@ActiveState.com

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