# std.heap.ArenaAllocator: fix \`reset\` creating undersized nodes · gitcafe/zig

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

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

Visibility: public

Requested revision: de4112395714b43890aa1e9d1e7dd952e8947288

Requested commit: de4112395714b43890aa1e9d1e7dd952e8947288

Commit: de4112395714b43890aa1e9d1e7dd952e8947288

Tree: 35566c638e59179349f37b2ef2c30620a657a446

Author: Justus Klausecker

Committer: Justus Klausecker

## Message

```
std.heap.ArenaAllocator: fix `reset` creating undersized nodes

Previously resetting with `retain_capacity < @sizeOf(Node)` would create
an invalid node. This is now fixed, plus `Node.size` now has its own `Size`
type that provides additional safety via assertions to prevent bugs like
this in the future.

```

## Parents

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

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