aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-02-02 16:30:34 +0000
committergingerBill <bill@gingerbill.org>2021-02-02 16:30:34 +0000
commit415379e1cffc9a69e5ddd9fca39135bc5e67bd8b (patch)
tree3000d9f9816df597fdf4455bfec9f50eb99667b1
parentd168c7936e6f0beca546a25c4f5f2d25a0ed6b0f (diff)
Fix `delete_map`
-rw-r--r--core/mem/alloc.odin2
-rw-r--r--core/runtime/core_builtin.odin2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/mem/alloc.odin b/core/mem/alloc.odin
index d5e0cef83..6347b236c 100644
--- a/core/mem/alloc.odin
+++ b/core/mem/alloc.odin
@@ -118,7 +118,7 @@ delete_slice :: proc(array: $T/[]$E, allocator := context.allocator, loc := #cal
}
delete_map :: proc(m: $T/map[$K]$V, loc := #caller_location) {
raw := transmute(Raw_Map)m;
- delete_slice(raw.hashes);
+ delete_slice(raw.hashes, raw.entries.allocator, loc);
free(raw.entries.data, raw.entries.allocator, loc);
}
diff --git a/core/runtime/core_builtin.odin b/core/runtime/core_builtin.odin
index 8a1be60d9..043010470 100644
--- a/core/runtime/core_builtin.odin
+++ b/core/runtime/core_builtin.odin
@@ -145,7 +145,7 @@ delete_slice :: proc(array: $T/[]$E, allocator := context.allocator, loc := #cal
@builtin
delete_map :: proc(m: $T/map[$K]$V, loc := #caller_location) {
raw := transmute(Raw_Map)m;
- delete_slice(raw.hashes);
+ delete_slice(raw.hashes, raw.entries.allocator, loc);
mem_free(raw.entries.data, raw.entries.allocator, loc);
}