Browse Source

Update `total_used` for `arena_static_reset_to`

gingerBill 2 năm trước cách đây
mục cha
commit
835b8ffa22
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      core/mem/virtual/arena.odin

+ 2 - 0
core/mem/virtual/arena.odin

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