what is the difference between
default_temp_allocator_destroy and
free_all(temp_allocator)
I traced the free_all all the way to Windows OS commands and understand that one.
It ends up at `_, err = allocator.procedure(allocator.data, .Free_All, 0, 0, nil, 0, loc).
The destroy calls
arena_destroy :: proc(arena: ^Arena, loc := #caller_location) {
for arena.curr_block != nil {
free_block := arena.curr_block
arena.curr_block = free_block.prev
arena.total_capacity -= free_block.capacity
memory_block_dealloc(free_block, loc)
}
arena.total_used = 0
arena.total_capacity = 0
}
which calls
memory_block_dealloc :: proc(block_to_free: ^Memory_Block, loc := #caller_location) {
if block_to_free != nil {
allocator := block_to_free.allocator
mem_free(block_to_free, allocator, loc)
}
}