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 10, 2000 08:38
Subject:
Re: [ID 20000409.003] Disappearing constant values
Message ID:
200004101537.IAA25453@maul.ActiveState.com
On Mon, 10 Apr 2000 08:26:14 BST, Nick Ing-Simmons wrote:
>Gurusamy Sarathy <gsar@ActiveState.com> writes:
>>
>>I'd say peek() should make a copy when moving it to the pad if the
>>SV is already a PADTMP.
>
>What does PADTMP _mean_ ?  (And where does one look fror such definitions?)

It simply signifies that the SV is lives on the scratchpad.  Such SVs
are of two kinds.  One kind has names (i.e. have corresponding entries
in the comppadname array) and are usually lexical/our variables.  The
other kind are nameless "temporaries" that may be allocated by any OP
for use during its lifetime.

>Is setting PADTMP on a constant the right thing to do in the first place?

Yes.  The constant SV is moved to the pad in order to keep it separate
between different threads that might share the same op tree.  (Otherwise,
you'd have to lock access to the constant, which we don't want to do.
And besides, constants are subject sv_upgrade() etc., which will break
things when multiple threads share the same SV.)


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