add another assertion

This commit is contained in:
Jarred Sumner
2022-03-14 05:39:22 -07:00
parent 00977c75ba
commit 13f1cdca7b

View File

@@ -141,7 +141,14 @@ const CAllocator = struct {
) void {
_ = buf_align;
_ = return_address;
mimalloc.mi_free(buf.ptr);
// mi_free_size internally just asserts the size
// so it's faster if we don't pass that value through
// but its good to have that assertion
if (comptime Environment.allow_assert) {
mimalloc.mi_free_size(buf.ptr, buf.len);
} else {
mimalloc.mi_free(buf.ptr);
}
}
};