[dovecot-cvs] dovecot/src/plugins/trash trash-plugin.c, 1.5.2.7, 1.5.2.8

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


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

Modified Files:
      Tag: branch_1_0
	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.5.2.7
retrieving revision 1.5.2.8
diff -u -d -r1.5.2.7 -r1.5.2.8
--- trash-plugin.c	22 Feb 2007 14:27:23 -0000	1.5.2.7
+++ trash-plugin.c	22 Feb 2007 15:03:44 -0000	1.5.2.8
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 
+#define INIT_TRASH_MAILBOX_COUNT 4
 #define MAX_RETRY_COUNT 3
 
 #define TRASH_CONTEXT(obj) \
@@ -326,7 +327,8 @@
 	}
 
 	p_clear(config_pool);
-	ARRAY_CREATE(&trash_boxes, config_pool, struct trash_mailbox, 8);
+	ARRAY_CREATE(&trash_boxes, config_pool, struct trash_mailbox,
+		     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) {
@@ -364,7 +366,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