develooper Front page | perl.perl5.porters | Postings from December 2011

Re: PERL_OLD_COPY_ON_WRITE

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
December 11, 2011 11:40
Subject:
Re: PERL_OLD_COPY_ON_WRITE
Message ID:
20111211194046.GB6564@tozt.net
On Sun, Dec 11, 2011 at 11:34:28AM -0800, Father Chrysostomos wrote:
> sv.c contains this comment:
> 
> #ifndef PERL_OLD_COPY_ON_WRITE
> 	     /* The change that added SV_COW_SHARED_HASH_KEYS makes the logic
> 		when PERL_OLD_COPY_ON_WRITE is defined a little wrong.
> 		Conceptually PERL_OLD_COPY_ON_WRITE being defined should
> 		override SV_COW_SHARED_HASH_KEYS, because it means "always COW"
> 		but in turn, it's somewhat dead code, never expected to go
> 		live, but more kept as a placeholder on how to do it better
> 		in a newer implementation.  */
> 
> What is wrong with PERL_OLD_COPY_ON_WRITE? Why wouldn’t it work the way it is written?

git blame points to here:

commit 34482cd6991b4dc2f3757baff881b50e6de59592
Author: Nicholas Clark <nick@ccl4.org>
Date:   Sun Nov 12 20:22:28 2006 +0000

    Change 24714 was arguably over-ambitious, in that non-core modules
    can't be expected to know that sv_setsv() may now not "really" copy a
    scalar. So arrange things so that COW of shared hash key scalars is
    only done for calls within the the PERL_CORE.
    
    p4raw-id: //depot/perl@29248

-doy

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