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;