Skip to content

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy