From 29cbe93ea5e845f6621c44dd73b0f3ebfbe7ddf4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 13 Oct 2025 19:23:55 +0200 Subject: [PATCH] basic/mempool: mark mempool_enabled as _pure_ The function internally does caching which means that the result must always be the same, the definition of a pure function. The compiler might be able to optimize some repeated calls to the function. (cherry picked from commit 882dfbde1c3159689eabadfab430aa9c272af163) --- src/basic/mempool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/mempool.h b/src/basic/mempool.h index 69fbae18a5f..3817b0c5b96 100644 --- a/src/basic/mempool.h +++ b/src/basic/mempool.h @@ -22,6 +22,6 @@ static struct mempool pool_name = { \ .at_least = alloc_at_least, \ } -__attribute__((weak)) bool mempool_enabled(void); +bool mempool_enabled(void) _weak_ _pure_; void mempool_trim(struct mempool *mp); -- 2.47.3