# HG changeset patch # User Timo Sirainen # Date 1204521570 -7200 # Node ID 5017c74367e372aaeb3830d1ce828dc6ebd4c73e # Parent 3bece69a5bfc6bacc8dec719173345a8141c2538 Added t_buffer_alloc_last_full(). 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 @@ 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 @@ #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);