]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: pool_alloconly_destroy() optimization - Don't clear the last block before free
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 23 Nov 2021 14:00:02 +0000 (15:00 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 20 Dec 2021 20:51:32 +0000 (20:51 +0000)
The block is going to be freed, so there's no need to clear it.
(The clearing still happens if clean_frees=TRUE.)

src/lib/mempool-alloconly.c

index 7ff578879ea50a6568e5b578d0e5cd2ed613517c..26f3360a4be040be8636be49cc9cdf5d3aff60bd 100644 (file)
@@ -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);