gpa: Add helper to calculate size class of empty buckets
commit61f1b2db704c9bfa96c6a965fdba57cf3692b2c9
authorHampus Fröjdholm <hampus.frojdholm@gmail.com>
Sat, 18 May 2024 09:43:42 +0000 (18 11:43 +0200)
committerHampus Fröjdholm <hampus.frojdholm@gmail.com>
Sat, 18 May 2024 09:43:42 +0000 (18 11:43 +0200)
treec9581f08f298b77908211240ad9a93f06364952d
parent6a65561e3e5f82f126ec4795e5cd9c07392b457b
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.
lib/std/heap/general_purpose_allocator.zig