summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-02-01 21:30:18 +0000
committerDamien George <damien.p.george@gmail.com>2016-04-18 15:09:34 +0100
commit2d9531a777e01c982ce8f2e5867b05bbac74373c (patch)
tree12cf4236684aaeab6a464a515269231d5c4d21db
parent238b5f5f891838de04faa1bd0718c069e14cc1fa (diff)
downloadmicropython-2d9531a777e01c982ce8f2e5867b05bbac74373c.tar.gz
micropython-2d9531a777e01c982ce8f2e5867b05bbac74373c.zip
py/vstr: Change allocation policy from *2 to +64.
-rw-r--r--py/vstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/vstr.c b/py/vstr.c
index 55c597bb12..181b1c49b9 100644
--- a/py/vstr.c
+++ b/py/vstr.c
@@ -151,7 +151,7 @@ STATIC bool vstr_ensure_extra(vstr_t *vstr, size_t size) {
if (vstr->fixed_buf) {
return false;
}
- size_t new_alloc = ROUND_ALLOC((vstr->len + size) * 2);
+ size_t new_alloc = ROUND_ALLOC((vstr->len + size) + 64);
char *new_buf = m_renew(char, vstr->buf, vstr->alloc, new_alloc);
if (new_buf == NULL) {
vstr->had_error = true;