mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-14 01:34:35 +00:00
zero tracking_allocator.allocation_map and tracking_allocator.bad_free_array in destroy. Allows for re-using the struct again after an init. Otherwise, there would be dangling references. e.g. to tracking_allocator.allocation_map.data
This commit is contained in:
@@ -82,6 +82,8 @@ Destroy the tracking allocator.
|
||||
tracking_allocator_destroy :: proc(t: ^Tracking_Allocator) {
|
||||
delete(t.allocation_map)
|
||||
delete(t.bad_free_array)
|
||||
t.allocation_map = {}
|
||||
t.bad_free_array = {}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user