mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 01:44:36 +00:00
Currently, `make(map[K]V, 0)` asserts, because trying `reserve` zero items does not set the allocator; it early-outs. `__dynamic_map_reserve` assumed that `__dynamic_array_reserve` would always set the allocator - even if given a desired capacity of `0`. Rather than making `__slice_resize` just _also_ set the default allocator if there isn't one, this makes `__dynamic_array_reserve` always set the allocator, even if it is about to early out. This is because users are lead to understand that `append` will set the allocator if one is not already set - `reserve` should work the same way.