This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv.c: Add comment
authorKarl Williamson <khw@cpan.org>
Sat, 31 May 2014 18:45:41 +0000 (12:45 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 1 Jun 2014 01:09:22 +0000 (19:09 -0600)
sv.c

diff --git a/sv.c b/sv.c
index bb7481a..13ea53c 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1584,6 +1584,9 @@ Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
        if (newlen < minlen)
            newlen = minlen;
 #ifndef PERL_UNWARANTED_CHUMMINESS_WITH_MALLOC
+
+        /* Don't round up on the first allocation, as odds are pretty good that
+         * the initial request is accurate as to what is really needed */
         if (SvLEN(sv)) {
             newlen = PERL_STRLEN_ROUNDUP(newlen);
         }