aboutsummaryrefslogtreecommitdiff
path: root/lib/std/array_hash_map.zig
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2021-12-13 15:01:05 +0100
committerVeikka Tuominen <git@vexu.eu>2022-01-27 19:35:08 +0200
commitf04007028ff0e9bc34267c5f0f27985917748496 (patch)
tree51009b9f5795532daee32ada029ce3dbb4d2a903 /lib/std/array_hash_map.zig
parentd86b8663fc0daab7bceade7689bf95fc20503b51 (diff)
downloadzig-f04007028ff0e9bc34267c5f0f27985917748496.tar.gz
zig-f04007028ff0e9bc34267c5f0f27985917748496.zip
Implement clone with initCapacity and appendSliceAssumeCapacity
`ArrayList.ensureTotalCapacityPrecise` uses `Allocator.reallocAtLeast` under the hood, which can return more than `new_capacity` bytes if `alignment != @alignOf(T)`. This implementation of `clone` assures that the case of `ensureTotalCapacityPrecise` is handled correctly. Thanks @Vexu and @squeek502 for pointing this out.
Diffstat (limited to 'lib/std/array_hash_map.zig')
0 files changed, 0 insertions, 0 deletions