Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7485:8bed019c834d HEAD
Memory pool allocation tweaks.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 04 May 2008 19:39:04 +0300 |
parents | 96f724a4a1a0 |
children | 9edaf878bb96 |
files | src/auth/auth-stream.c src/auth/db-passwd-file.c src/lib-index/mail-index-map.c src/lib-mail/istream-header-filter.c src/lib/env-util.c |
diffstat | 5 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/auth-stream.c Sun May 04 19:38:11 2008 +0300 +++ b/src/auth/auth-stream.c Sun May 04 19:39:04 2008 +0300 @@ -15,7 +15,7 @@ struct auth_stream_reply *reply; reply = p_new(pool, struct auth_stream_reply, 1); - reply->str = str_new(pool, 256); + reply->str = str_new(pool, 128); return reply; }
--- a/src/auth/db-passwd-file.c Sun May 04 19:38:11 2008 +0300 +++ b/src/auth/db-passwd-file.c Sun May 04 19:39:04 2008 +0300 @@ -178,7 +178,7 @@ pw->stamp = st.st_mtime; pw->size = st.st_size; - pw->pool = pool_alloconly_create("passwd_file", 10240);; + pw->pool = pool_alloconly_create(MEMPOOL_GROWING"passwd_file", 10240); pw->users = hash_create(default_pool, pw->pool, 100, str_hash, (hash_cmp_callback_t *)strcmp);
--- a/src/lib-index/mail-index-map.c Sun May 04 19:38:11 2008 +0300 +++ b/src/lib-index/mail-index-map.c Sun May 04 19:39:04 2008 +0300 @@ -25,7 +25,7 @@ size = EXT_GLOBAL_ALLOC_SIZE + initial_count * EXT_PER_ALLOC_SIZE; map->extension_pool = - pool_alloconly_create("map extensions", + pool_alloconly_create(MEMPOOL_GROWING"map extensions", nearest_power(size)); } else { p_clear(map->extension_pool);
--- a/src/lib-mail/istream-header-filter.c Sun May 04 19:38:11 2008 +0300 +++ b/src/lib-mail/istream-header-filter.c Sun May 04 19:39:04 2008 +0300 @@ -398,7 +398,8 @@ i_assert((flags & (HEADER_FILTER_INCLUDE|HEADER_FILTER_EXCLUDE)) != 0); mstream = i_new(struct header_filter_istream, 1); - mstream->pool = pool_alloconly_create("header filter stream", 4096); + mstream->pool = pool_alloconly_create(MEMPOOL_GROWING + "header filter stream", 4096); mstream->istream.max_buffer_size = input->real_stream->max_buffer_size; mstream->headers = headers_count == 0 ? NULL :
--- a/src/lib/env-util.c Sun May 04 19:38:11 2008 +0300 +++ b/src/lib/env-util.c Sun May 04 19:39:04 2008 +0300 @@ -9,9 +9,10 @@ void env_put(const char *env) { - if (pool == NULL) - pool = pool_alloconly_create("Environment", 2048); - + if (pool == NULL) { + pool = pool_alloconly_create(MEMPOOL_GROWING"Environment", + 2048); + } if (putenv(p_strdup(pool, env)) != 0) i_fatal("putenv(%s) failed: %m", env); }