[dovecot-cvs] dovecot/src/plugins/trash trash-plugin.c,1.18,1.19

tss at dovecot.org tss at dovecot.org
Thu Feb 22 15:03:52 UTC 2007


Update of /var/lib/cvs/dovecot/src/plugins/trash
In directory talvi:/tmp/cvs-serv16915

Modified Files:
	trash-plugin.c 
Log Message:
Minor memory allocation optimizations.



Index: trash-plugin.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/trash/trash-plugin.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- trash-plugin.c	22 Feb 2007 14:27:43 -0000	1.18
+++ trash-plugin.c	22 Feb 2007 15:03:46 -0000	1.19
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 
+#define INIT_TRASH_MAILBOX_COUNT 4
 #define MAX_RETRY_COUNT 3
 
 struct trash_mailbox {
@@ -236,7 +237,7 @@
 	}
 
 	p_clear(config_pool);
-	p_array_init(&trash_boxes, config_pool, 8);
+	p_array_init(&trash_boxes, config_pool, INIT_TRASH_MAILBOX_COUNT);
 
 	input = i_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
@@ -271,7 +272,11 @@
 		return;
 	}
 
-	config_pool = pool_alloconly_create("trash config", 1024);
+	config_pool = pool_alloconly_create("trash config",
+					sizeof(trash_boxes) +
+					BUFFER_APPROX_SIZE +
+					INIT_TRASH_MAILBOX_COUNT *
+					(sizeof(struct trash_mailbox) + 32));
 	if (read_configuration(env) < 0)
 		return;
 



More information about the dovecot-cvs mailing list