mem/virtual: fix arena_static_reset_to inverted logic

This commit is contained in:
Laytan
2024-02-06 20:24:38 +01:00
parent 4e300ff90a
commit 9b4cd0743c

View File

@@ -143,8 +143,8 @@ arena_static_reset_to :: proc(arena: ^Arena, pos: uint, loc := #caller_location)
prev_pos := arena.curr_block.used
arena.curr_block.used = clamp(pos, 0, arena.curr_block.reserved)
if prev_pos < pos {
mem.zero_slice(arena.curr_block.base[arena.curr_block.used:][:pos-prev_pos])
if prev_pos > pos {
mem.zero_slice(arena.curr_block.base[arena.curr_block.used:][:prev_pos-pos])
}
arena.total_used = arena.curr_block.used
return true