Skip to content

Conversation

@schell
Copy link
Owner

@schell schell commented Nov 5, 2025

These changes replace SlabAllocator with Arena.

craballoc is interesting in that it is essentially a bump-allocated arena that runs on top of a u32 slab. These changes refactor and rename SlabAllocator to Arena to reflect that fact, as well as provide a more concise API and some new features, mainly:

  • round-trip synchronization of values
  • opt out for CPU-cached values
  • opt out for GPU synchronization

These changes also include rather rigorous proptest tests.

@schell schell changed the title Arena Arena allocator Nov 17, 2025
@schell schell marked this pull request as ready for review November 28, 2025 20:18
@schell schell linked an issue Nov 28, 2025 that may be closed by this pull request
@schell schell merged commit 6b81637 into main Nov 29, 2025
1 check passed
@schell schell deleted the arena branch November 29, 2025 00:14
@LegNeato
Copy link

FWIW I have been looking at https://github.com/SFBdragon/talc for something similar though I have yet to really use it. One nice feature is on OOM you can call back to the host and request more memory if needed or aggressively reap.

@schell
Copy link
Owner Author

schell commented Dec 1, 2025

Thanks @LegNeato. That looks pretty similar. Currently craballoc doesn't handle OOM, as it just allocs more, but eventually it would run into the runtime's buffer maximum. That would be a hard error though.

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.

Arena allocator with roundtrip values

3 participants