Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7326:5017c74367e3 HEAD
Added t_buffer_alloc_last_full().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 03 Mar 2008 07:19:30 +0200 |
parents | 3bece69a5bfc |
children | a1b8a12521a0 |
files | src/lib/data-stack.c src/lib/data-stack.h |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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
--- 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 @@ #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);