https://github.com/unrays/unsynchronized-chunk-allocator
A C++ unsynchronized chunk-based memory allocator with monotonic allocation strategy for high-performance workloads.
https://github.com/unrays/unsynchronized-chunk-allocator
allocator arena-allocator cache-friendly compiler-backend cpp cpp-library custom-allocator data-structures high-performance low-level-programming memory-allocator memory-management memory-pool monotonic-allocator performance pmr quebec systems-programming zero-overhead
Last synced: about 5 hours ago
JSON representation
A C++ unsynchronized chunk-based memory allocator with monotonic allocation strategy for high-performance workloads.
- Host: GitHub
- URL: https://github.com/unrays/unsynchronized-chunk-allocator
- Owner: unrays
- License: bsl-1.0
- Created: 2026-05-22T19:06:04.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-22T20:09:42.000Z (about 2 months ago)
- Last Synced: 2026-05-22T22:28:25.144Z (about 2 months ago)
- Topics: allocator, arena-allocator, cache-friendly, compiler-backend, cpp, cpp-library, custom-allocator, data-structures, high-performance, low-level-programming, memory-allocator, memory-management, memory-pool, monotonic-allocator, performance, pmr, quebec, systems-programming, zero-overhead
- Language: C++
- Homepage: https://unrays.github.io/unsynchronized-chunk-allocator/
- Size: 30.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Unsynchronized Chunk Allocator
A C++ unsynchronized chunk-based memory allocator with monotonic allocation strategy for high-performance workloads. This project is part of the **EXOTIC::memory** library.
## Overview
This project started as a technical challenge I set for myself within the scope of a compiler-related work.
It required a solid understanding of allocators, as they form the foundation of precise lifetime management and efficient data structures in low-level systems.
To approach this, I studied the design of `std::pmr` and related allocator models, taking notes and extracting the core ideas that I found most relevant.
It took me around three weeks to arrive at a functional implementation.
This is not a simple copy of an existing allocator from the internet. While I drew inspiration from established standards and allocator design principles, I implemented the system in a very educational and deliberate way, focusing on clarity and understanding.
I’m genuinely proud of this work, and it will be used as part of a compiler project where it fulfills its original goal.
---
## Example Usage
```cpp
// In this case, we use a monotonic atomic buffer as the memory backend
exotic::memory::monotonic_atomic_buffer upstream(1 << 20);
exotic::memory::unsynchronized_chunk_allocator allocator(&upstream);
// Allocate raw memory for 10 ints
int* data = allocator.allocate(10);
// Construct objects in-place
allocator.construct(data, 42);
// High-level allocation helper
auto* obj = allocator.new_object(123);
// Destroy (no-op deallocation model)
allocator.destroy(obj);
```
---
## Notes
This project is intentionally minimal in scope and focused on learning and system-level understanding rather than being a production-ready general-purpose allocator. This project is the result of the skills I have undoubtedly acquired over the past 7 months since I started learning C++. Also, the very library-like aspect with `exotic::memory` is simply because it looks cooler and more professional :)
## License
This project is licensed under the Boost Software License. See the [LICENSE](LICENSE) file for details.
© Félix-Olivier Dumas 2026