# gpa: Add helper to calculate size class of empty buckets · gitcafe/zig

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

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

Visibility: public

Requested revision: 61f1b2db704c9bfa96c6a965fdba57cf3692b2c9

Requested commit: 61f1b2db704c9bfa96c6a965fdba57cf3692b2c9

Commit: 61f1b2db704c9bfa96c6a965fdba57cf3692b2c9

Tree: c9581f08f298b77908211240ad9a93f06364952d

Author: Hampus Fröjdholm

Committer: Hampus Fröjdholm

## Message

```
gpa: Add helper to calculate size class of empty buckets

Empty buckets have their `alloc_cursor` set to `slot_count` to allow the
size class to be calculated later. This happens deep within the free
function.

This adds a helper and a test to verify that the size class of empty
buckets is indeed recoverable.

```

## Parents

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

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