Skip to content

slab/multislab/pool: reject bad releases, fix limits, add LIBMEM_ASSERT - #11

Merged
aotodev merged 1 commit into
masterfrom
6-slabmultislabpool-hardening-and-limits
Sep 29, 2026
Merged

aotodev merged 1 commit into
masterfrom
6-slabmultislabpool-hardening-and-limits

Conversation

@aotodev

@aotodev aotodev commented Sep 29, 2026

Copy link
Copy Markdown
Owner
  • multislab::deallocate rejects a foreign or misaligned pointer, a double
    free and end() before touching bookkeeping; slab::deallocate(_at)
    return whether they released
  • grow() no longer leaks the node when the slab allocation throws
  • slab clamps memory past MaxBlocks instead of asserting
  • valid_slab_geometry rejects sizes that overflow size_t; bitmap
    indices are computed in size_t
  • pool::erase asserts it != end(); slab_limit is explicit and range
    checked
  • every runtime check goes through LIBMEM_ASSERT, contract_assert
    under LIBMEM_CONTRACTS; not usable yet on GCC 16

Closes #6

@aotodev aotodev linked an issue Sep 29, 2026 that may be closed by this pull request
@aotodev
aotodev merged commit 33533f0 into master Sep 29, 2026
5 checks passed
@aotodev
aotodev deleted the 6-slabmultislabpool-hardening-and-limits branch September 29, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slab/multislab/pool: hardening and limits

1 participant