From 4587a56466f0c55d91ece168f0dc872f81a8196c Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 23 May 2020 05:30:16 +0200 Subject: block processor: recycle blocks to reduce allocation pressure Instead of freeing/allocating blocks all the time in the locked, serial path, use a free list to "recycle" blocks. Once a block is no longer used, throw it onto the free list. If a new block is, needed try to get one from the free list before calling malloc. After a few iterations, the block processor should stop allocating new blocks and only re-use the ones it already has. Signed-off-by: David Oberhollenzer --- lib/sqfs/block_processor/internal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqfs/block_processor/internal.h') diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h index fed0842..eff5374 100644 --- a/lib/sqfs/block_processor/internal.h +++ b/lib/sqfs/block_processor/internal.h @@ -54,6 +54,8 @@ struct sqfs_block_processor_t { sqfs_u32 blk_flags; sqfs_u32 blk_index; + sqfs_block_t *free_list; + size_t max_block_size; }; -- cgit v1.2.3