From: Timo Sirainen Date: Tue, 23 Nov 2021 14:00:02 +0000 (+0100) Subject: lib: pool_alloconly_destroy() optimization - Don't clear the last block before free X-Git-Tag: 2.3.18~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a74574d3934bf6120d9ca9479cb4275998b365c;p=thirdparty%2Fdovecot%2Fcore.git lib: pool_alloconly_destroy() optimization - Don't clear the last block before free The block is going to be freed, so there's no need to clear it. (The clearing still happens if clean_frees=TRUE.) --- diff --git a/src/lib/mempool-alloconly.c b/src/lib/mempool-alloconly.c index 7ff578879e..26f3360a4b 100644 --- a/src/lib/mempool-alloconly.c +++ b/src/lib/mempool-alloconly.c @@ -312,7 +312,7 @@ pool_alloconly_free_blocks_until_last(struct alloconly_pool *apool) static void pool_alloconly_destroy(struct alloconly_pool *apool) { /* destroy all but the last block */ - pool_alloconly_clear(&apool->pool); + pool_alloconly_free_blocks_until_last(apool); /* destroy the last block */ pool_alloconly_free_block(apool, apool->block);