charset.c (convert_no_conversion): Reallocate memory with 25% headroom.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 2 Oct 2014 00:06:28 +0000 (00:06 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Thu, 2 Oct 2014 00:06:28 +0000 (00:06 +0000)
2014-10-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
            Jeff Law  <law@redhat.com>

        * charset.c (convert_no_conversion): Reallocate memory with 25%
        headroom.

Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r215785

libcpp/ChangeLog
libcpp/charset.c

index 4ad851e705e94e1e86cdbecfaeadca8792f27691..3b23708d39ae045b5a2b5007ee6fb34a17fdf223 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+           Jeff Law  <law@redhat.com>
+
+       * charset.c (convert_no_conversion): Reallocate memory with 25%
+       headroom.
+
 2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
        Implement SD-6: SG10 Feature Test Recommendations
index b766eec8b220e7506af67aeb3bc8265d26e7f526..1064f5276332ad486ccfb75d87628fd6eafef462 100644 (file)
@@ -537,6 +537,7 @@ convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED,
   if (to->len + flen > to->asize)
     {
       to->asize = to->len + flen;
+      to->asize += to->asize / 4;
       to->text = XRESIZEVEC (uchar, to->text, to->asize);
     }
   memcpy (to->text + to->len, from, flen);