[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c,1.32,1.33
cras at procontrol.fi
cras at procontrol.fi
Fri Jan 24 04:38:39 EET 2003
Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv32411/lib-storage/index/mbox
Modified Files:
mbox-save.c
Log Message:
Memory usage tweaks
Index: mbox-save.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-save.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- mbox-save.c 22 Jan 2003 19:23:28 -0000 1.32
+++ mbox-save.c 24 Jan 2003 02:38:37 -0000 1.33
@@ -15,8 +15,6 @@
#include <netdb.h>
struct mail_save_context {
- pool_t pool;
-
struct index_mailbox *ibox;
int transaction;
@@ -224,7 +222,6 @@
{
struct index_mailbox *ibox = (struct index_mailbox *) box;
struct mail_save_context *ctx;
- pool_t pool;
if (box->readonly) {
mail_storage_set_error(box->storage, "Mailbox is read-only");
@@ -234,19 +231,17 @@
if (!index_storage_sync_and_lock(ibox, FALSE, MAIL_LOCK_EXCLUSIVE))
return NULL;
- pool = pool_alloconly_create("mail_save_context", 2048);
- ctx = p_new(pool, struct mail_save_context, 1);
- ctx->pool = pool;
+ ctx = i_new(struct mail_save_context, 1);
ctx->ibox = ibox;
ctx->transaction = transaction;
if (!mbox_seek_to_end(ctx, &ctx->sync_offset)) {
- pool_unref(pool);
+ i_free(ctx);
return NULL;
}
ctx->output = o_stream_create_file(ibox->index->mbox_fd,
- ctx->pool, 4096, 0, FALSE);
+ default_pool, 4096, 0, FALSE);
o_stream_set_blocking(ctx->output, 60000, NULL, NULL);
return ctx;
}
@@ -272,6 +267,6 @@
}
}
- pool_unref(ctx->pool);
+ i_free(ctx);
return !failed;
}
More information about the dovecot-cvs
mailing list