summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2015-06-28 18:30:29 -0700
committerFather Chrysostomos <sprout@cpan.org>2015-06-29 08:20:28 -0700
commit93c10d608c4f8b29a548e6e6da3816375c034859 (patch)
treee54250d236da59cadc1edcfffe8f68ce37f96cb4
parentb326ddffeee24461c6f5622c518bb5a454b10935 (diff)
downloadperl-93c10d608c4f8b29a548e6e6da3816375c034859.tar.gz
Remove NEW_ from PERL_NEW_COPY_ON_WRITE
-rw-r--r--dump.c2
-rw-r--r--makedef.pl2
-rw-r--r--op.c2
-rw-r--r--perl.c6
-rw-r--r--perl.h8
-rw-r--r--sv.c10
-rw-r--r--sv.h2
7 files changed, 16 insertions, 16 deletions
diff --git a/dump.c b/dump.c
index 4f7b48d432..c4d4018135 100644
--- a/dump.c
+++ b/dump.c
@@ -1620,7 +1620,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
if (!re)
Perl_dump_indent(aTHX_ level, file, " LEN = %"IVdf"\n",
(IV)SvLEN(sv));
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
if (SvIsCOW(sv) && SvLEN(sv))
Perl_dump_indent(aTHX_ level, file, " COW_REFCNT = %d\n",
CowREFCNT(sv));
diff --git a/makedef.pl b/makedef.pl
index 362797ade7..297cbc7591 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -285,7 +285,7 @@ else {
);
}
-unless ($define{'PERL_NEW_COPY_ON_WRITE'}) {
+unless ($define{'PERL_COPY_ON_WRITE'}) {
++$skip{Perl_sv_setsv_cow};
}
diff --git a/op.c b/op.c
index c50da69853..e00e754548 100644
--- a/op.c
+++ b/op.c
@@ -11949,7 +11949,7 @@ Perl_ck_svconst(pTHX_ OP *o)
SV * const sv = cSVOPo->op_sv;
PERL_ARGS_ASSERT_CK_SVCONST;
PERL_UNUSED_CONTEXT;
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
/* Since the read-only flag may be used to protect a string buffer, we
cannot do copy-on-write with existing read-only scalars that are not
already copy-on-write scalars. To allow $_ = "hello" to do COW with
diff --git a/perl.c b/perl.c
index b6a3d87585..cbb66e0730 100644
--- a/perl.c
+++ b/perl.c
@@ -1692,6 +1692,9 @@ S_Internals_V(pTHX_ CV *cv)
# ifdef PERL_BOOL_AS_CHAR
" PERL_BOOL_AS_CHAR"
# endif
+# ifdef PERL_COPY_ON_WRITE
+ " PERL_COPY_ON_WRITE"
+# endif
# ifdef PERL_DISABLE_PMC
" PERL_DISABLE_PMC"
# endif
@@ -1737,9 +1740,6 @@ S_Internals_V(pTHX_ CV *cv)
# ifdef PERL_MEM_LOG_NOIMPL
" PERL_MEM_LOG_NOIMPL"
# endif
-# ifdef PERL_NEW_COPY_ON_WRITE
- " PERL_NEW_COPY_ON_WRITE"
-# endif
# ifdef PERL_PERTURB_KEYS_DETERMINISTIC
" PERL_PERTURB_KEYS_DETERMINISTIC"
# endif
diff --git a/perl.h b/perl.h
index 9715e57cc1..bcfeee94d7 100644
--- a/perl.h
+++ b/perl.h
@@ -2643,12 +2643,12 @@ typedef AV PAD;
typedef struct padnamelist PADNAMELIST;
typedef struct padname PADNAME;
-/* enable PERL_NEW_COPY_ON_WRITE by default */
-#if !defined(PERL_NEW_COPY_ON_WRITE) && !defined(PERL_NO_COW)
-# define PERL_NEW_COPY_ON_WRITE
+/* enable PERL_COPY_ON_WRITE by default */
+#if !defined(PERL_COPY_ON_WRITE) && !defined(PERL_NO_COW)
+# define PERL_COPY_ON_WRITE
#endif
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
# define PERL_ANY_COW
#else
# define PERL_SAWAMPERSAND
diff --git a/sv.c b/sv.c
index efe6e3a715..b4a36e51a0 100644
--- a/sv.c
+++ b/sv.c
@@ -1583,7 +1583,7 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
s = SvPVX_mutable(sv);
}
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
/* the new COW scheme uses SvPVX(sv)[SvLEN(sv)-1] (if spare)
* to store the COW count. So in general, allocate one more byte than
* asked for, to make it likely this byte is always spare: and thus
@@ -4621,7 +4621,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, SV* sstr, const I32 flags)
}
else if (flags & SV_COW_SHARED_HASH_KEYS
&&
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
(sflags & SVf_IsCOW
? (!len ||
( (CHECK_COWBUF_THRESHOLD(cur,len) || SvLEN(dstr) < cur+1)
@@ -4752,7 +4752,7 @@ Perl_sv_setsv_cow(pTHX_ SV *dstr, SV *sstr)
STRLEN cur = SvCUR(sstr);
STRLEN len = SvLEN(sstr);
char *new_pv;
-#if defined(PERL_DEBUG_READONLY_COW) && defined(PERL_NEW_COPY_ON_WRITE)
+#if defined(PERL_DEBUG_READONLY_COW) && defined(PERL_COPY_ON_WRITE)
const bool already = cBOOL(SvIsCOW(sstr));
#endif
@@ -5097,7 +5097,7 @@ S_sv_uncow(pTHX_ SV * const sv, const U32 flags)
sv_dump(sv);
}
SvIsCOW_off(sv);
-# ifdef PERL_NEW_COPY_ON_WRITE
+# ifdef PERL_COPY_ON_WRITE
if (len) {
/* Must do this first, since the CowREFCNT uses SvPVX and
we need to write to CowREFCNT, or de-RO the whole buffer if we are
@@ -8158,7 +8158,7 @@ Perl_sv_gets(pTHX_ SV *const sv, PerlIO *const fp, I32 append)
if (fd >= 0 && (PerlLIO_fstat(fd, &st) == 0) && S_ISREG(st.st_mode)) {
const Off_t offset = PerlIO_tell(fp);
if (offset != (Off_t) -1 && st.st_size + append > offset) {
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
/* Add an extra byte for the sake of copy-on-write's
* buffer reference count. */
(void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 2));
diff --git a/sv.h b/sv.h
index 5b5994e4bf..49cafe47bf 100644
--- a/sv.h
+++ b/sv.h
@@ -1864,7 +1864,7 @@ Like sv_utf8_upgrade, but doesn't do magic on C<sv>.
#define SV_CHECK_THINKFIRST_COW_DROP(sv) if (SvTHINKFIRST(sv)) \
sv_force_normal_flags(sv, SV_COW_DROP_PV)
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_COPY_ON_WRITE
# define SvCANCOW(sv) \
(SvIsCOW(sv) \
? SvLEN(sv) ? CowREFCNT(sv) != SV_COW_REFCNT_MAX : 1 \