aboutsummaryrefslogtreecommitdiff
path: root/src/RangeSet.zig
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2021-11-01 00:38:11 -0700
committerRyan Liptak <squeek502@hotmail.com>2021-11-01 00:57:24 -0700
commitf49d42729a22846ec54b6610db415ac8cdaa31db (patch)
treecfd5a54c5d1dbaed017511a740fd4f4cf5593cf9 /src/RangeSet.zig
parent83dcfd62053a80024b1cb282fddf399a36c9c58e (diff)
downloadzig-f49d42729a22846ec54b6610db415ac8cdaa31db.tar.gz
zig-f49d42729a22846ec54b6610db415ac8cdaa31db.zip
std.ArrayList: add ensureTotalCapacityPrecise and update doc comments
initCapacity did and still does use the ensureTotalCapacityPrecise logic because the initial capacity of an ArrayList is not important in terms of how it grows, so allocating a more exact slice up-front allows for saving memory when the array list never exceeds that initial allocation size. There are use cases where this precise capacity is useful outside of the `init` function, though, like in instances where the user does not call the `init` function themselves but otherwise knows that an ArrayList is empty so calling `ensureTotalCapacityPrecise` can give the same memory savings that `initCapacity` would have. Closes #9775
Diffstat (limited to 'src/RangeSet.zig')
0 files changed, 0 insertions, 0 deletions