diff --git a/base/runtime/core_builtin.odin b/base/runtime/core_builtin.odin index aed3444d8..324efb05d 100644 --- a/base/runtime/core_builtin.odin +++ b/base/runtime/core_builtin.odin @@ -403,6 +403,7 @@ make_map_cap :: proc($T: typeid/map[$K]$E, #any_int capacity: int, allocator := make_map_expr_error_loc(loc, capacity) context.allocator = allocator + m.allocator = allocator err = reserve_map(&m, capacity, loc) return } diff --git a/base/runtime/core_builtin_soa.odin b/base/runtime/core_builtin_soa.odin index ef8603ba4..e76b1eae9 100644 --- a/base/runtime/core_builtin_soa.odin +++ b/base/runtime/core_builtin_soa.odin @@ -159,6 +159,7 @@ make_soa_dynamic_array_len :: proc($T: typeid/#soa[dynamic]$E, #any_int length: @(builtin, require_results) make_soa_dynamic_array_len_cap :: proc($T: typeid/#soa[dynamic]$E, #any_int length, capacity: int, allocator := context.allocator, loc := #caller_location) -> (array: T, err: Allocator_Error) #optional_allocator_error { context.allocator = allocator + array.allocator = allocator reserve_soa(&array, capacity, loc) or_return resize_soa(&array, length, loc) or_return return array, nil