From e8ca4a24fa8455ac42eda33ba3ab1d7c49b024e4 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 1 Mar 2026 13:28:30 +0000 Subject: [PATCH] Add `assert` to `freelist_push_with_index` --- core/container/xar/freelist.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/container/xar/freelist.odin b/core/container/xar/freelist.odin index c2afca0d0..4b11014f5 100644 --- a/core/container/xar/freelist.odin +++ b/core/container/xar/freelist.odin @@ -29,7 +29,8 @@ freelist_clear :: proc(x: ^$X/Freelist_Array($T, $SHIFT)) { freelist_push_with_index :: proc(x: ^$X/Freelist_Array($T, $SHIFT), value: T, loc := #caller_location) -> (ptr: ^T, index: int, err: runtime.Allocator_Error) { if x.freelist != nil { slot := x.freelist - idx, _ := freelist_linear_search(x, slot) + idx, found := freelist_linear_search(x, slot) + assert(found) x.freelist = (^^T)(slot)^ slot^ = value return slot, idx, nil