mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
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.
This commit is contained in:
@@ -2315,7 +2315,7 @@ buddy_allocator_alloc_bytes_non_zeroed :: proc(b: ^Buddy_Allocator, size: uint)
|
|||||||
if size != 0 {
|
if size != 0 {
|
||||||
actual_size := buddy_block_size_required(b, size)
|
actual_size := buddy_block_size_required(b, size)
|
||||||
found := buddy_block_find_best(b.head, b.tail, actual_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
|
// Try to coalesce all the free buddy blocks and then search again
|
||||||
buddy_block_coalescence(b.head, b.tail)
|
buddy_block_coalescence(b.head, b.tail)
|
||||||
found = buddy_block_find_best(b.head, b.tail, actual_size)
|
found = buddy_block_find_best(b.head, b.tail, actual_size)
|
||||||
|
|||||||
Reference in New Issue
Block a user