summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-02 13:36:01 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-02 13:36:01 +0000
commit7a9b70e91d2c0aa19f8cec5b0f8c133492a19280 (patch)
treea7189a0b6ed5aba44b00173c76f0b082b3724e0a /sv.c
parent345dbb93fc4813c4387eb6b1eedefc6d79a752d0 (diff)
downloadperl-7a9b70e91d2c0aa19f8cec5b0f8c133492a19280.tar.gz
Changes 24660 and 24665 both introduced errors into the USEMYMALLOC
code. Plus change 24672 appears to break under USEMYMALLOC, so revert it for now. p4raw-id: //depot/perl@24676
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index 9a61a355e9..e71ac3abdb 100644
--- a/sv.c
+++ b/sv.c
@@ -2040,8 +2040,8 @@ Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen)
s = SvPVX(sv);
if (newlen > SvLEN(sv)) { /* need more room? */
+ newlen = PERL_STRLEN_ROUNDUP(newlen);
if (SvLEN(sv) && s) {
- newlen = PERL_STRLEN_ROUNDUP(newlen);
#ifdef MYMALLOC
const STRLEN l = malloced_size((void*)SvPVX(sv));
if (newlen <= l) {
@@ -2052,7 +2052,6 @@ Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen)
s = saferealloc(s, newlen);
}
else {
- newlen = PERL_STRLEN_ROUNDUP(newlen);
s = safemalloc(newlen);
if (SvPVX(sv) && SvCUR(sv)) {
Move(SvPVX(sv), s, (newlen < SvCUR(sv)) ? newlen : SvCUR(sv), char);
@@ -4825,7 +4824,7 @@ Perl_sv_usepvn(pTHX_ register SV *sv, register char *ptr, register STRLEN len)
SvPV_free(sv);
allocate = PERL_STRLEN_ROUNDUP(len + 1);
- ptr = safesysrealloc (ptr, allocate);
+ ptr = saferealloc (ptr, allocate);
SvPV_set(sv, ptr);
SvCUR_set(sv, len);
SvLEN_set(sv, allocate);