aboutsummaryrefslogtreecommitdiff
path: root/core/mem
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-06-19 19:33:51 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-06-19 19:33:51 -0400
commit4e9f15965a9aba66833a1b377094d8b1544f155c (patch)
tree2a2158ad684996c0bc82bed61514bfa36a67ec43 /core/mem
parent7d670cff0d80fdba2d97a60669c8bf8877104a67 (diff)
mem: Fix inverted condition in `buddy_allocator_alloc_bytes_non_zeroed`
This was causing the procedure to find a block, then find one again, or to not find a block and not try again.
Diffstat (limited to 'core/mem')
-rw-r--r--core/mem/allocators.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin
index 21e69c463..a40ab245e 100644
--- a/core/mem/allocators.odin
+++ b/core/mem/allocators.odin
@@ -2315,7 +2315,7 @@ buddy_allocator_alloc_bytes_non_zeroed :: proc(b: ^Buddy_Allocator, size: uint)
if size != 0 {
actual_size := buddy_block_size_required(b, size)
found := buddy_block_find_best(b.head, b.tail, actual_size)
- if found != nil {
+ if found == nil {
// Try to coalesce all the free buddy blocks and then search again
buddy_block_coalescence(b.head, b.tail)
found = buddy_block_find_best(b.head, b.tail, actual_size)