Skip to content

Commit

Permalink
Revert "sv_grow: performance improvement for short strings"
Browse files Browse the repository at this point in the history
This reverts commit 880c169.
  • Loading branch information
Father Chrysostomos committed Sep 1, 2014
1 parent 2c9f1bc commit 3c239be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)

#ifdef PERL_NEW_COPY_ON_WRITE
/* the new COW scheme uses SvPVX(sv)[SvLEN(sv)-1] (if spare)
* to store the CowREFCNT. So in general, allocate one more byte than
* 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
* make more strings COW-able.
* If the new size is a big power of two, don't bother: we assume the
Expand All @@ -1560,7 +1560,7 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)

if (newlen > SvLEN(sv)) { /* need more room? */
STRLEN minlen = SvCUR(sv);
minlen += (minlen >> PERL_STRLEN_EXPAND_SHIFT) + 2;
minlen += (minlen >> PERL_STRLEN_EXPAND_SHIFT) + 10;
if (newlen < minlen)
newlen = minlen;
#ifndef PERL_UNWARANTED_CHUMMINESS_WITH_MALLOC
Expand Down

0 comments on commit 3c239be

Please sign in to comment.