dovecot-1.1: Added t_buffer_alloc_last_full().

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 3 07:20:42 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/5017c74367e3
changeset: 7326:5017c74367e3
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 03 07:19:30 2008 +0200
description:
Added t_buffer_alloc_last_full().

diffstat:

2 files changed, 8 insertions(+)
src/lib/data-stack.c |    6 ++++++
src/lib/data-stack.h |    2 ++

diffs (28 lines):

diff -r 3bece69a5bfc -r 5017c74367e3 src/lib/data-stack.c
--- a/src/lib/data-stack.c	Mon Mar 03 06:25:11 2008 +0200
+++ b/src/lib/data-stack.c	Mon Mar 03 07:19:30 2008 +0200
@@ -443,6 +443,12 @@ void t_buffer_alloc(size_t size)
 	t_malloc_real(size, TRUE);
 }
 
+void t_buffer_alloc_last_full(void)
+{
+	if (last_buffer_block != NULL)
+		t_malloc_real(last_buffer_size, TRUE);
+}
+
 void data_stack_set_clean_after_pop(bool enable ATTR_UNUSED)
 {
 #ifndef DEBUG
diff -r 3bece69a5bfc -r 5017c74367e3 src/lib/data-stack.h
--- a/src/lib/data-stack.h	Mon Mar 03 06:25:11 2008 +0200
+++ b/src/lib/data-stack.h	Mon Mar 03 07:19:30 2008 +0200
@@ -97,6 +97,8 @@ void *t_buffer_reget(void *buffer, size_
 #define t_buffer_alloc_type(type, size) \
         t_buffer_alloc(sizeof(type) * (size))
 void t_buffer_alloc(size_t size);
+/* Allocate the last t_buffer_get()ed data entirely. */
+void t_buffer_alloc_last_full(void);
 
 /* If enabled, all the used memory is cleared after t_pop(). */
 void data_stack_set_clean_after_pop(bool enable);


More information about the dovecot-cvs mailing list