]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Memory pool allocation tweaks.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 May 2008 16:39:04 +0000 (19:39 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 May 2008 16:39:04 +0000 (19:39 +0300)
--HG--
branch : HEAD

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

index 0611888b78d42865105a7c2a5334d485f1a74bce..93bb9f745f0a12eb50419fe0c1d885db89abe150 100644 (file)
@@ -15,7 +15,7 @@ struct auth_stream_reply *auth_stream_reply_init(pool_t pool)
        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;
 }
 
index f97f4ff2e75ad5f42d3019a2fa4b931a04455254..ccf8a2543af45f2a68c76a246daaee6422ef90a7 100644 (file)
@@ -178,7 +178,7 @@ static bool passwd_file_open(struct passwd_file *pw)
        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);
 
index 6413461d9541870af9c4eb5e02686d3dfcf4a7b9..bdb74d206b99c23a864f4f59848e4e3eb16c67ce 100644 (file)
@@ -25,7 +25,7 @@ static void mail_index_map_init_extbufs(struct mail_index_map *map,
                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);
index e3f085bb5f5a70ebade39c1f6d8dc5176532292e..175ba546ba6bf866c49de15aa510e148ce7201a4 100644 (file)
@@ -398,7 +398,8 @@ i_stream_create_header_filter(struct istream *input,
        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 :
index fb1d7989f43384b9f62cab14fb1eca2cb8cfa037..708709b216c06fd38930d729ce1e6961ec3aac0e 100644 (file)
@@ -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);
 }