dovecot-2.2: virtual plugin: Optimized memory allocation.

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 13 09:53:45 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/e7c5944ba16b
changeset: 17712:e7c5944ba16b
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 13 12:51:41 2014 +0300
description:
virtual plugin: Optimized memory allocation.
Patch by Teemu Huovila.

diffstat:

 src/plugins/virtual/virtual-sync.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r 0150ca67d7f7 -r e7c5944ba16b src/plugins/virtual/virtual-sync.c
--- a/src/plugins/virtual/virtual-sync.c	Tue Aug 12 19:30:37 2014 +0300
+++ b/src/plugins/virtual/virtual-sync.c	Wed Aug 13 12:51:41 2014 +0300
@@ -1519,6 +1519,7 @@
 	const struct virtual_mail_index_record *vrec;
 
 	messages = mail_index_view_get_messages_count(ctx->sync_view);
+	i_array_init(&ctx->all_mails, messages);
 	for (vseq = 1; vseq <= messages; vseq++) {
 		mail_index_lookup_ext(ctx->sync_view, vseq,
 				      ctx->mbox->virtual_ext_id, &mail_data, NULL);
@@ -1542,10 +1543,8 @@
 	
 	/* we have different optimizations depending on whether the virtual
 	   mailbox consists of multiple backend boxes or just one */
-	if (count > 1) {
-		i_array_init(&ctx->all_mails, 128);
+	if (count > 1)
 		virtual_sync_bboxes_get_mails(ctx);
-	}
 
 	for (i = 0; i < count; i++) {
 		if (virtual_sync_backend_box(ctx, bboxes[i]) < 0) {


More information about the dovecot-cvs mailing list