From 6e9b1b344b7f7b04a2ae4ace0a1d191f63d03396 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 30 Mar 2022 18:23:59 +0100 Subject: buflib: remove buflib_print_allocs / buflib_print_blocks These don't have any users and there is already another way to print blocks (which is actually used by the debug menu). Change-Id: Ic6a4f874c6499c42bc046e8af3e4aaddc9e68276 --- firmware/buflib.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'firmware/buflib.c') diff --git a/firmware/buflib.c b/firmware/buflib.c index 2ed13b49b1..6bfc499235 100644 --- a/firmware/buflib.c +++ b/firmware/buflib.c @@ -1068,52 +1068,6 @@ void buflib_check_valid(struct buflib_context *ctx) } #endif -#ifdef BUFLIB_DEBUG_BLOCKS -void buflib_print_allocs(struct buflib_context *ctx, - void (*print)(int, const char*)) -{ - union buflib_data *this, *end = ctx->handle_table; - char buf[128]; - for(this = end - 1; this >= ctx->last_handle; this--) - { - if (!this->alloc) continue; - - int handle_num = end - this; - void* alloc_start = this->alloc; - union buflib_data *block_start = handle_to_block(ctx, handle_num); - const char* name = buflib_get_name(ctx, handle_num); - intptr_t alloc_len = block_start[fidx_LEN]; - - snprintf(buf, sizeof(buf), - "%s(%d):\t%p\n" - " \t%p\n" - " \t%ld\n", - name?:"(null)", handle_num, block_start, alloc_start, alloc_len); - /* handle_num is 1-based */ - print(handle_num - 1, buf); - } -} - -void buflib_print_blocks(struct buflib_context *ctx, - void (*print)(int, const char*)) -{ - char buf[128]; - int i = 0; - - for(union buflib_data *block = ctx->buf_start; - block != ctx->alloc_end; - block += abs(block->val)) - { - check_block_length(ctx, block); - - snprintf(buf, sizeof(buf), "%8p: val: %4ld (%s)", - block, (long)block->val, - block->val > 0 ? block[fidx_NAME].name : ""); - print(i++, buf); - } -} -#endif - #ifdef BUFLIB_DEBUG_BLOCK_SINGLE int buflib_get_num_blocks(struct buflib_context *ctx) { -- cgit v1.2.3