diff --git a/base/runtime/heap_allocator_control.odin b/base/runtime/heap_allocator_control.odin index 356e00477..737870c04 100644 --- a/base/runtime/heap_allocator_control.odin +++ b/base/runtime/heap_allocator_control.odin @@ -17,11 +17,11 @@ compact_superpage :: proc "contextless" (superpage: ^Heap_Superpage) -> (freed: if slab.bin_size > HEAP_MAX_BIN_SIZE { // Skip contiguous slabs. i += heap_slabs_needed_for_size(slab.bin_size) - } else if slab.bin_size > 0 { - i += 1 } else { i += 1 - continue + if slab.bin_size == 0 { + continue + } } slab_is_cached := slab.free_bins > 0 diff --git a/base/runtime/heap_allocator_implementation.odin b/base/runtime/heap_allocator_implementation.odin index 5e21bfa14..d7148d8d2 100644 --- a/base/runtime/heap_allocator_implementation.odin +++ b/base/runtime/heap_allocator_implementation.odin @@ -490,11 +490,11 @@ heap_cache_register_superpage :: proc "contextless" (superpage: ^Heap_Superpage) if slab.bin_size > HEAP_MAX_BIN_SIZE { // Skip contiguous slabs. i += heap_slabs_needed_for_size(slab.bin_size) - } else if slab.bin_size > 0 { - i += 1 } else { i += 1 - continue + if slab.bin_size == 0 { + continue + } } // When adopting a new Superpage, we take the opportunity to @@ -1274,11 +1274,11 @@ setup_superpage_orphanage :: proc "contextless" () { if slab.bin_size > HEAP_MAX_BIN_SIZE { // Skip contiguous slabs. i += heap_slabs_needed_for_size(slab.bin_size) - } else if slab.bin_size > 0 { - i += 1 } else { i += 1 - continue + if slab.bin_size == 0 { + continue + } } if intrinsics.atomic_load_explicit(&slab.remote_free_bins_scheduled, .Acquire) > 0 {