memkit-async 0.2.0-beta.1

Async-aware memory allocators for memkit
docs.rs failed to build memkit-async-0.2.0-beta.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: memkit-async-0.1.0-alpha.1

◈ 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 START◈ ADVANTAGE◈ POLICIES


◈ 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 ]