dovecot-1.1: Memory pool allocation tweaks.
dovecot at dovecot.org
dovecot at dovecot.org
Sun May 4 19:39:09 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/8bed019c834d
changeset: 7485:8bed019c834d
user: Timo Sirainen <tss at iki.fi>
date: Sun May 04 19:39:04 2008 +0300
description:
Memory pool allocation tweaks.
diffstat:
5 files changed, 9 insertions(+), 7 deletions(-)
src/auth/auth-stream.c | 2 +-
src/auth/db-passwd-file.c | 2 +-
src/lib-index/mail-index-map.c | 2 +-
src/lib-mail/istream-header-filter.c | 3 ++-
src/lib/env-util.c | 7 ++++---
diffs (66 lines):
diff -r 96f724a4a1a0 -r 8bed019c834d src/auth/auth-stream.c
--- 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 *auth_stream_re
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;
}
diff -r 96f724a4a1a0 -r 8bed019c834d src/auth/db-passwd-file.c
--- 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 @@ static bool passwd_file_open(struct pass
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);
diff -r 96f724a4a1a0 -r 8bed019c834d src/lib-index/mail-index-map.c
--- 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 @@ static void mail_index_map_init_extbufs(
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);
diff -r 96f724a4a1a0 -r 8bed019c834d src/lib-mail/istream-header-filter.c
--- 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_stream_create_header_filter(struct ist
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 :
diff -r 96f724a4a1a0 -r 8bed019c834d src/lib/env-util.c
--- 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 @@ static pool_t pool = NULL;
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);
}
More information about the dovecot-cvs
mailing list