From: Zbigniew Jędrzejewski-Szmek Date: Mon, 13 Oct 2025 17:23:55 +0000 (+0200) Subject: basic/mempool: mark mempool_enabled as _pure_ X-Git-Tag: v259-rc1~264^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=882dfbde1c3159689eabadfab430aa9c272af163;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/mempool.h b/src/basic/mempool.h index a6f990d124b..1dd1e4e314c 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);