# Added initCapacity and relevant test · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/10e6cde083cf9ddd1ae72850d45c25b1258d0d7e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 10e6cde083cf9ddd1ae72850d45c25b1258d0d7e

Requested commit: 10e6cde083cf9ddd1ae72850d45c25b1258d0d7e

Commit: 10e6cde083cf9ddd1ae72850d45c25b1258d0d7e

Tree: b38f84bf63cf00f3fb5c2beae445a09f0ecdf50f

Author: MCRusher

Committer: GitHub

## Message

```
Added initCapacity and relevant test

Added ArrayList.initCapcity() as a way to preallocate a block of memory to reduce future allocations.

Added a test "std.ArrayList.initCapacity" that ensures initCapacity adds no elements and increases capacity by at least the requested amount
```

## Parents

- [29d7b5a80c9faf640c3db0de14cd229e90b2d8c3](https://git.cafe/gitcafe/zig/commit/29d7b5a80c9faf640c3db0de14cd229e90b2d8c3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/10e6cde083cf9ddd1ae72850d45c25b1258d0d7e?format=markdown)
