diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 15:36:32 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 15:36:32 +0000 |
commit | cd0a89b0931d51015e4e94b010926f0c75767cee (patch) | |
tree | fbbffee961abcea767a1ed70f60014f2ec174e99 /string.c | |
parent | 909291085c87b41d6718c2630ee49210eb9d9684 (diff) |
merge revision(s) r45534: [Backport #9709]
* string.c (str_buf_cat): should round up the capacity by 4KiB,
but not number of rooms. [ruby-core:61886] [Bug #9709]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2098,7 +2098,7 @@ str_buf_cat(VALUE str, const char *ptr, long len) if (capa <= total) { while (total > capa) { if (capa + termlen >= LONG_MAX / 2) { - capa = (total + 4095) / 4096; + capa = (total + 4095) / 4096 * 4096; break; } capa = (capa + termlen) * 2; |