From 59d9f6cb0b2136136560838689245988a60b9b3e Mon Sep 17 00:00:00 2001 From: Radkesvat <134321679+radkesvat@users.noreply.github.com> Date: Sun, 19 May 2024 13:52:08 +0000 Subject: [PATCH] trim on shrinking --- ww/buffer_pool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ww/buffer_pool.c b/ww/buffer_pool.c index 31b0ebd0..99a82fac 100644 --- a/ww/buffer_pool.c +++ b/ww/buffer_pool.c @@ -1,4 +1,5 @@ #include "buffer_pool.h" +#include #ifdef DEBUG #include "loggers/network_logger.h" #endif @@ -60,6 +61,7 @@ static void giveMemBackToOs(buffer_pool_t *pool) #ifdef DEBUG LOGD("BufferPool: freed %d buffers, %zu are in use", decrease, pool->in_use); #endif + malloc_trim(0); } shift_buffer_t *popBuffer(buffer_pool_t *pool)