| Crates.io | memkit |
| lib.rs | memkit |
| version | 0.1.0-alpha.1 |
| created_at | 2025-12-27 00:39:10.730052+00 |
| updated_at | 2025-12-27 00:39:10.730052+00 |
| description | Deterministic, intent-driven memory allocation for systems requiring predictable performance |
| homepage | |
| repository | https://github.com/YelenaTor/memkit |
| max_upload_size | |
| id | 2006492 |
| size | 112,516 |
Core CPU memory allocation primitives for the memkit ecosystem.
Version: 0.1.0-alpha.1
memkit provides deterministic, intent-driven memory allocation for game engines and real-time applications. It offers predictable performance through explicit lifetimes and zero-cost abstractions.
use memkit::{MkAllocator, MkConfig};
let alloc = MkAllocator::new(MkConfig::default());
// Game loop
loop {
alloc.begin_frame();
// Frame allocations - ultra fast, reset automatically
let positions = alloc.frame_slice::<[f32; 3]>(1000).unwrap();
let velocities = alloc.frame_slice::<[f32; 3]>(1000).unwrap();
// Pool allocations - returned to pool on drop
let entity = alloc.pool_box(Entity::new()).unwrap();
// Scoped allocations
{
let _scope = alloc.scope();
let temp = alloc.frame_box(TempData::new()).unwrap();
// temp freed when scope drops
}
alloc.end_frame(); // Instant reset
}
| Type | Description |
|---|---|
MkAllocator |
Main allocator entry point |
MkConfig |
Allocator configuration |
MkFrameBox<T> |
Frame-allocated box |
MkFrameSlice<T> |
Frame-allocated slice |
MkFrameVec<T> |
Frame-allocated vector |
MkPoolBox<T> |
Pool-allocated box |
MkHeapBox<T> |
Heap-allocated box |
MkScope |
Scoped checkpoint guard |
let config = MkConfig {
frame_arena_size: 64 * 1024 * 1024, // 64 MB per thread
slab_size_classes: vec![16, 32, 64, 128, 256, 512, 1024, 2048, 4096],
debug_mode: cfg!(debug_assertions),
..Default::default()
};
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE.md file for details.