Explorar el Código

[Minor] Grow small strings more quickly

tags/3.3
Vsevolod Stakhov hace 1 año
padre
commit
aec9ff27cb
No account linked to committer's email address
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6
    1
      src/libutil/fstring.c

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

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

Cargando…
Cancelar
Guardar