Mercurial > dovecot > core-2.2
changeset 17638:a5f479be46b9
lib: cosmetic - whitespace cleanup in allocator/memory-related code
Indentation used spaces. Some trailing whitespace found.
$ git diff -w
$
Signed-off-by: Phil Carmody <phil@dovecot.fi>
author | Phil Carmody <phil@dovecot.fi> |
---|---|
date | Mon, 28 Jul 2014 16:45:33 +0300 |
parents | d3914e9ffba3 |
children | b4eec0a20bba |
files | src/lib/data-stack.c src/lib/data-stack.h src/lib/imem.c src/lib/mempool-alloconly.c src/lib/mempool-system.c src/lib/mempool.h |
diffstat | 6 files changed, 32 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/data-stack.c Mon Jul 28 16:45:33 2014 +0300 +++ b/src/lib/data-stack.c Mon Jul 28 16:45:33 2014 +0300 @@ -52,7 +52,7 @@ struct stack_frame_block *prev; struct stack_block *block[BLOCK_FRAME_COUNT]; - size_t block_space_used[BLOCK_FRAME_COUNT]; + size_t block_space_used[BLOCK_FRAME_COUNT]; size_t last_alloc_size[BLOCK_FRAME_COUNT]; #ifdef DEBUG const char *marker[BLOCK_FRAME_COUNT]; @@ -120,7 +120,7 @@ unsigned int t_push(const char *marker) { - struct stack_frame_block *frame_block; + struct stack_frame_block *frame_block; frame_pos++; if (frame_pos == BLOCK_FRAME_COUNT) { @@ -158,7 +158,7 @@ /* mark our current position */ current_frame_block->block[frame_pos] = current_block; current_frame_block->block_space_used[frame_pos] = current_block->left; - current_frame_block->last_alloc_size[frame_pos] = 0; + current_frame_block->last_alloc_size[frame_pos] = 0; #ifdef DEBUG current_frame_block->marker[frame_pos] = marker; current_frame_block->alloc_bytes[frame_pos] = 0ULL; @@ -167,7 +167,7 @@ (void)marker; /* only used for debugging */ #endif - return data_stack_frame++; + return data_stack_frame++; } unsigned int t_push_named(const char *format, ...) @@ -295,7 +295,7 @@ unused_frame_blocks = frame_block; } - return --data_stack_frame; + return --data_stack_frame; } void t_pop_check(unsigned int *id) @@ -384,7 +384,7 @@ current_block->lowwater = current_block->left - alloc_size; } - if (permanent) + if (permanent) current_block->left -= alloc_size; } else { /* current block is full, see if we can use the unused_block */ @@ -433,12 +433,12 @@ /* we rely on errno not changing. it shouldn't. */ i_assert(errno == old_errno); #endif - return ret; + return ret; } void *t_malloc(size_t size) { - return t_malloc_real(size, TRUE); + return t_malloc_real(size, TRUE); } void *t_malloc0(size_t size) @@ -447,7 +447,7 @@ mem = t_malloc_real(size, TRUE); memset(mem, 0, size); - return mem; + return mem; } bool t_try_realloc(void *mem, size_t size) @@ -502,17 +502,17 @@ void *t_buffer_reget(void *buffer, size_t size) { size_t old_size; - void *new_buffer; + void *new_buffer; old_size = last_buffer_size; if (size <= old_size) - return buffer; + return buffer; new_buffer = t_buffer_get(size); if (new_buffer != buffer) - memcpy(new_buffer, buffer, old_size); + memcpy(new_buffer, buffer, old_size); - return new_buffer; + return new_buffer; } void t_buffer_alloc(size_t size) @@ -573,7 +573,7 @@ #ifndef USE_GC while (unused_frame_blocks != NULL) { - struct stack_frame_block *frame_block = unused_frame_blocks; + struct stack_frame_block *frame_block = unused_frame_blocks; unused_frame_blocks = unused_frame_blocks->prev; free(frame_block);
--- a/src/lib/data-stack.h Mon Jul 28 16:45:33 2014 +0300 +++ b/src/lib/data-stack.h Mon Jul 28 16:45:33 2014 +0300 @@ -109,7 +109,7 @@ less or equal than the size you gave with last t_buffer_get() or the result will be undefined. */ #define t_buffer_alloc_type(type, size) \ - t_buffer_alloc(sizeof(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);
--- a/src/lib/imem.c Mon Jul 28 16:45:33 2014 +0300 +++ b/src/lib/imem.c Mon Jul 28 16:45:33 2014 +0300 @@ -6,22 +6,22 @@ void *i_malloc(size_t size) { - return p_malloc(default_pool, size); + return p_malloc(default_pool, size); } void *i_realloc(void *mem, size_t old_size, size_t new_size) { - return p_realloc(default_pool, mem, old_size, new_size); + return p_realloc(default_pool, mem, old_size, new_size); } char *i_strdup(const char *str) { - return p_strdup(default_pool, str); + return p_strdup(default_pool, str); } char *i_strdup_empty(const char *str) { - return p_strdup_empty(default_pool, str); + return p_strdup_empty(default_pool, str); } char *i_strdup_until(const void *str, const void *end) @@ -31,30 +31,30 @@ char *i_strndup(const void *str, size_t max_chars) { - return p_strndup(default_pool, str, max_chars); + return p_strndup(default_pool, str, max_chars); } char *i_strdup_printf(const char *format, ...) { va_list args; - char *ret; + char *ret; - va_start(args, format); + va_start(args, format); ret = p_strdup_vprintf(default_pool, format, args); va_end(args); - return ret; + return ret; } char *i_strdup_vprintf(const char *format, va_list args) { - return p_strdup_vprintf(default_pool, format, args); + return p_strdup_vprintf(default_pool, format, args); } char *i_strconcat(const char *str1, ...) { va_list args; char *ret; - size_t len; + size_t len; va_start(args, str1); @@ -71,5 +71,5 @@ } T_END; va_end(args); - return ret; + return ret; }
--- a/src/lib/mempool-alloconly.c Mon Jul 28 16:45:33 2014 +0300 +++ b/src/lib/mempool-alloconly.c Mon Jul 28 16:45:33 2014 +0300 @@ -294,7 +294,7 @@ apool->block->last_alloc_size) == mem) { memset(mem, 0, apool->block->last_alloc_size); apool->block->left += apool->block->last_alloc_size; - apool->block->last_alloc_size = 0; + apool->block->last_alloc_size = 0; } } @@ -342,7 +342,7 @@ mem = new_mem; } - return mem; + return mem; } static void pool_alloconly_clear(pool_t pool)
--- a/src/lib/mempool-system.c Mon Jul 28 16:45:33 2014 +0300 +++ b/src/lib/mempool-system.c Mon Jul 28 16:45:33 2014 +0300 @@ -136,11 +136,11 @@ } if (old_size < new_size) { - /* clear new data */ + /* clear new data */ memset((char *) mem + old_size, 0, new_size - old_size); } - return mem; + return mem; } static void ATTR_NORETURN
--- a/src/lib/mempool.h Mon Jul 28 16:45:33 2014 +0300 +++ b/src/lib/mempool.h Mon Jul 28 16:45:33 2014 +0300 @@ -88,8 +88,8 @@ in some "optimization".. */ #define p_free(pool, mem) \ STMT_START { \ - p_free_internal(pool, mem); \ - (mem) = NULL; \ + p_free_internal(pool, mem); \ + (mem) = NULL; \ } STMT_END /* A macro that's guaranteed to set mem = NULL. */