Преглед изворни кода

[Minor] Grow small strings more quickly

tags/3.3
Vsevolod Stakhov пре 1 година
родитељ
комит
aec9ff27cb
No account linked to committer's email address
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6
    1
      src/libutil/fstring.c

+ 6
- 1
src/libutil/fstring.c Прегледај датотеку

@@ -125,7 +125,12 @@ rspamd_fstring_suggest_size (gsize len, gsize allocated, gsize needed_len)
{
gsize newlen, optlen = 0;

newlen = MAX (len + needed_len, 1 + allocated * 3 / 2);
if (allocated < 4096) {
newlen = MAX (len + needed_len, allocated * 2);
}
else {
newlen = MAX (len + needed_len, 1 + allocated * 3 / 2);
}

#ifdef HAVE_MALLOC_SIZE
optlen = sys_alloc_size (newlen + sizeof (rspamd_fstring_t));

Loading…
Откажи
Сачувај