8000 py/vstr: Change allocation policy from *2 to +64. · godlygeek/circuitpython@2d9531a · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d9531a

Browse files
committed
py/vstr: Change allocation policy from *2 to +64.
1 parent 238b5f5 commit 2d9531a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/vstr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ STATIC bool vstr_ensure_extra(vstr_t *vstr, size_t size) {
151151
if (vstr->fixed_buf) {
152152
return false;
153153
}
154-
size_t new_alloc = ROUND_ALLOC((vstr->len + size) * 2);
154+
size_t new_alloc = ROUND_ALLOC((vstr->len + size) + 64);
155155
char *new_buf = m_renew(char, vstr->buf, vstr->alloc, new_alloc);
156156
if (new_buf == NULL) {
157157
vstr->had_error = true;

0 commit comments

Comments
 (0)
0