# add std.MultiArrayList · gitcafe/zig

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

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

Visibility: public

Requested revision: 0808d98e10c5fea27cebf912c6296b760c2b837b

Requested commit: 0808d98e10c5fea27cebf912c6296b760c2b837b

Commit: 0808d98e10c5fea27cebf912c6296b760c2b837b

Tree: 6a226079208b7c9c71d75ecfaee502b306e6d1be

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
add std.MultiArrayList

Also known as "Struct-Of-Arrays" or "SOA". The purpose of this data
structure is to provide a similar API to ArrayList but instead of
the element type being a struct, the fields of the struct are in N
different arrays, all with the same length and capacity.

Having this abstraction means we can put them in the same allocation,
avoiding overhead with the allocator. It also saves a tiny bit of
overhead from the redundant capacity and length fields, since each
struct element shares the same value.

This is an alternate implementation to #7854.

```

## Parents

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

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