Mercurial > dovecot > original-hg > dovecot-1.2
diff src/lib-index/mbox/mbox-rewrite.c @ 404:f25e575bf1ca HEAD
Created datastack_mempool which is used by at least a few temporary
IOBuffers. Some other minor speedups/cleanups in IOBuffer and elsewhere..
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 10 Oct 2002 05:01:34 +0300 |
parents | 60040a9d243f |
children | 1f0e7229ee58 |
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-rewrite.c Thu Oct 10 04:45:42 2002 +0300 +++ b/src/lib-index/mbox/mbox-rewrite.c Thu Oct 10 05:01:34 2002 +0300 @@ -362,8 +362,11 @@ if (lseek(out_fd, (off_t)out_offset, SEEK_SET) < 0) return -1; - inbuf = io_buffer_create_mmap(in_fd, default_pool, 65536, 0, 0, FALSE); - outbuf = io_buffer_create_file(out_fd, default_pool, 1024, FALSE); + t_push(); + + inbuf = io_buffer_create_mmap(in_fd, data_stack_pool, + 1024*256, 0, 0, 0); + outbuf = io_buffer_create_file(out_fd, data_stack_pool, 1024, FALSE); ret = io_buffer_send_iobuffer(outbuf, inbuf, inbuf->size); if (ret < 0) @@ -376,6 +379,7 @@ io_buffer_unref(outbuf); io_buffer_unref(inbuf); + t_pop(); return ret; } @@ -447,7 +451,8 @@ } dirty_offset = 0; - outbuf = io_buffer_create_file(tmp_fd, default_pool, 8192, FALSE); + t_push(); + outbuf = io_buffer_create_file(tmp_fd, data_stack_pool, 8192, FALSE); failed = FALSE; seq = 1; rec = index->lookup(index, 1); @@ -522,6 +527,7 @@ io_buffer_unref(inbuf); io_buffer_unref(outbuf); + t_pop(); if (!failed) { /* POSSIBLE DATA LOSS HERE. We're writing to the mbox file,