From 34fc6996b00af7ed8bedce08d69bb7db2d03dc7d Mon Sep 17 00:00:00 2001 From: apio Date: Mon, 17 Oct 2022 18:52:11 +0200 Subject: [PATCH] UserHeap: allocate needed memory in request_virtual_pages --- kernel/src/memory/UserHeap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/src/memory/UserHeap.cpp b/kernel/src/memory/UserHeap.cpp index f25f09ed..b9876a8c 100644 --- a/kernel/src/memory/UserHeap.cpp +++ b/kernel/src/memory/UserHeap.cpp @@ -2,6 +2,7 @@ #include "memory/UserHeap.h" #include "log/Log.h" +#include "misc/utils.h" #include "std/stdlib.h" #include "std/string.h" @@ -137,7 +138,7 @@ allocate: } } - if (attempts < 5 && try_expand()) + if (attempts == 0 && try_expand_size(Utilities::get_blocks_from_size(8, count) + 256)) { attempts++; goto allocate;