dovecot: Added t_buffer_alloc_last_full().
dovecot at dovecot.org
dovecot at dovecot.org
Mon Mar 3 07:20:45 EET 2008
details: http://hg.dovecot.org/dovecot/rev/26d7e3336a48
changeset: 7321:26d7e3336a48
user: Timo Sirainen <tss at iki.fi>
date: Mon Mar 03 07:19:31 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 2fca2f050f33 -r 26d7e3336a48 src/lib/data-stack.c
--- a/src/lib/data-stack.c Mon Mar 03 06:25:14 2008 +0200
+++ b/src/lib/data-stack.c Mon Mar 03 07:19:31 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 2fca2f050f33 -r 26d7e3336a48 src/lib/data-stack.h
--- a/src/lib/data-stack.h Mon Mar 03 06:25:14 2008 +0200
+++ b/src/lib/data-stack.h Mon Mar 03 07:19:31 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