summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--string.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ddd4ad666..9e378c1088 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 15 08:25:15 2016 Jeremy Evans <code@jeremyevans.net>
+
+ * string.c (STR_BUF_MIN_SIZE): reduce from 128 to 127
+ [ruby-core:76371] [Feature #12025]
+ * string.c (rb_str_buf_new): adjust for above reduction
+
Thu Jul 14 17:26:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (enc/unicode/name2ctype.h): remove stale recipe,
diff --git a/string.c b/string.c
index ff3792ffb2..4bc4ebfd99 100644
--- a/string.c
+++ b/string.c
@@ -1188,7 +1188,7 @@ str_new_empty(VALUE str)
return v;
}
-#define STR_BUF_MIN_SIZE 128
+#define STR_BUF_MIN_SIZE 127
VALUE
rb_str_buf_new(long capa)
@@ -2590,7 +2590,7 @@ str_buf_cat(VALUE str, const char *ptr, long len)
capa = (total + 4095) / 4096 * 4096;
break;
}
- capa = 2 * capa;
+ capa = 2 * capa + 1;
}
}
else {