]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: pools: make sure 'no-memory-trimming' is always used
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Mar 2023 13:52:30 +0000 (14:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Mar 2023 16:29:23 +0000 (17:29 +0100)
The global option 'no-memory-trimming' was added in 2.6 with commit
c4e56dc58 ("MINOR: pools: add a new global option "no-memory-trimming"")
but there were some cases left where it was not considered. Let's make
is_trim_enabled() also consider it.

src/pool.c

index 214d950fb7beed7fe6e31726b150caf6c04eaacf..908b3340f514d891b22499fe890309ba8ba1db74 100644 (file)
@@ -213,7 +213,7 @@ static void detect_allocator(void)
 
 int is_trim_enabled(void)
 {
-       return using_default_allocator;
+       return !disable_trim && using_default_allocator;
 }
 
 static int mem_should_fail(const struct pool_head *pool)