Ver código fonte

[Minor] Grow small strings more quickly

tags/3.3
Vsevolod Stakhov 1 ano atrás
pai
commit
aec9ff27cb
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 6 adições e 1 exclusões
  1. 6
    1
      src/libutil/fstring.c

+ 6
- 1
src/libutil/fstring.c Ver arquivo

@@ -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));

Carregando…
Cancelar
Salvar