diff --git a/src/pool.c b/src/pool.c index c69143a08..dc8496365 100644 --- a/src/pool.c +++ b/src/pool.c @@ -345,12 +345,11 @@ void pool_gc(struct pool_head *pool_ctx) } } - if (!isolated) - thread_release(); - #if defined(HA_HAVE_MALLOC_TRIM) malloc_trim(0); #endif + if (!isolated) + thread_release(); } #else /* CONFIG_HAP_LOCKLESS_POOLS */ @@ -402,6 +401,10 @@ void pool_gc(struct pool_head *pool_ctx) } } +#if defined(HA_HAVE_MALLOC_TRIM) + malloc_trim(0); +#endif + if (!isolated) thread_release(); }