Make map_free_dynamic take the total size of the allocation

This commit is contained in:
gingerBill
2022-11-08 15:40:30 +00:00
parent 2f29894b45
commit dae299b781
3 changed files with 31 additions and 25 deletions
+1 -2
View File
@@ -125,8 +125,7 @@ delete_slice :: proc(array: $T/[]$E, allocator := context.allocator, loc := #cal
return free(raw_data(array), allocator, loc)
}
delete_map :: proc(m: $T/map[$K]$V, loc := #caller_location) -> Allocator_Error {
raw := transmute(Raw_Map)m
return runtime.map_free(raw, loc)
return runtime.map_free_dynamic(transmute(Raw_Map)m, runtime.map_info(T), loc)
}