diff options
| author | John Schmidt <john.schmidt.h@gmail.com> | 2021-12-13 15:01:05 +0100 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-01-27 19:35:08 +0200 |
| commit | f04007028ff0e9bc34267c5f0f27985917748496 (patch) | |
| tree | 51009b9f5795532daee32ada029ce3dbb4d2a903 /lib/std/array_hash_map.zig | |
| parent | d86b8663fc0daab7bceade7689bf95fc20503b51 (diff) | |
| download | zig-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
