4 releases

0.2.0-beta.1 Feb 2, 2026
0.1.1-beta.1 Feb 2, 2026
0.1.0-beta.1 Feb 2, 2026
0.1.0-alpha.1 Dec 27, 2025

#624 in Asynchronous

MPL-2.0 license

210KB
4.5K SLoC

◈ MEMKIT ASYNC ◈

[ TASK-LOCAL ASYNC-NATIVE ALLOCATION ]

Crates.io Documentation License


 █████╗ ███████╗██╗   ██╗███╗   ██╗ ██████╗ 
██╔══██╗██╔════╝╚██╗ ██╔╝████╗  ██║██╔════╝ 
███████║███████╗ ╚████╔╝ ██╔██╗ ██║██║      
██╔══██║╚════██║  ╚██╔╝  ██║╚██╗██║██║      
██║  ██║███████║   ██║   ██║ ╚████║╚██████╗ 
╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═══╝ ╚═════╝ 

"Memory that moves with your tasks, not your threads."

Task-local, async-native memory management for Rust. Avoid the pitfalls of crossing .await points with high-speed arenas and managed pools.

QUICK STARTADVANTAGEPOLICIES


◈ THE ASYNC ADVANTAGE

Feature Standard Box Memkit Async Impact
Safety Runtime-only Task-local Thread-safe .await
Locality Random Contiguous Cache efficient
Pressure None Wait/Fail System stability
Throughput Lock-heavy Lock-Free Optimized scaling

◈ FEATURES

┌─────────────────────────────────────────────────────────────────────────┐
│  ◆ TASK-LOCAL  │  Isolated arenas tied to specific async tasks. Correcly │
│                │  preserves locality even during task migration.         │
├─────────────────────────────────────────────────────────────────────────┤
│  ◆ BACKPRESSURE│  Integrated semantics for memory limits: `Wait`, `Fail`, │
│                │  `Timeout`, or `Evict`.                                 │
├─────────────────────────────────────────────────────────────────────────┤
│  ◆ ZERO-COPY   │  Move entire arenas between tasks without memory moves. │
│                │  Ideal for producer-consumer pipelines.                 │
└─────────────────────────────────────────────────────────────────────────┘

◈ QUICK START

use memkit_async::{MkAsyncFrameAlloc, MkAsyncFrameConfig};

#[tokio::main]
async fn main() {
    let alloc = MkAsyncFrameAlloc::new(MkAsyncFrameConfig::default());
    
    // Begin a task-managed frame
    let frame = alloc.begin_frame().await;
    
    // Allocate high-speed data safe across .await points
    let data = alloc.alloc::<BigData>().await;
    
    do_some_io().await; // Task might move between threads here...
    
    process(data);      // ...but memory remains safe and contiguous!
}

◈ BACKPRESSURE POLICIES

Policy Behavior
Wait Suspends task until space is available.
Fail Immediately returns CapacityReached error.
Timeout Waits for duration before returning error.
Evict Discards oldest entries (ideal for caches).

◈ INTEGRATION

Enable the tokio feature for native runtime support.

[dependencies]
memkit-async = { version = "0.2.0-beta.1", features = ["tokio"] }

◈ LICENSE

Licensed under the Mozilla Public License 2.0.


[ Part of the ◈ MEMKIT ◈ Ecosystem ]

Dependencies

~0.1–0.8MB
~12K SLoC