Expand description
§Auto Allocator - Zero-Configuration Memory Optimization
Just add one line and get optimal memory performance automatically!
Auto-allocator automatically selects the best memory allocator for your platform and hardware, giving you significant performance improvements without any configuration or code changes.
§Why Auto Allocator?
- 🚀 Instant Performance: Up to 1.6x faster allocation in multi-threaded applications
- 🔧 Zero Configuration: Works perfectly out-of-the-box, no setup required
- 🌍 Universal Compatibility: Optimizes across all platforms - servers, desktop, mobile, embedded, WASM
- 🧠 Platform Intelligence: Automatically chooses the best allocator for each platform
- ⚡ Production Ready: Used safely in high-performance production environments
§Quick Start
Step 1: Add to your Cargo.toml
:
[dependencies]
auto-allocator = "*"
Step 2: Add one line to your main.rs
:
ⓘ
use auto_allocator; // That's it! 🎉
fn main() {
// Your code automatically runs with optimal memory performance
let data = vec![1, 2, 3, 4, 5];
println!("Memory allocations are now optimized!");
}
That’s literally all you need! Auto-allocator handles everything else automatically.
§What You Get
- Linux Servers: mimalloc for superior multi-threaded performance
- Windows/macOS: mimalloc for desktop application speed
- Android/iOS: Platform-optimized system allocators (Scudo/libmalloc)
- Docker/Kubernetes: Optimized for containerized deployments
- Embedded Systems: Automatic embedded-alloc for all no_std platforms (RISC-V, ARM, AVR, MSP430, Xtensa, etc.)
- WASM: Compatible allocation for web applications
Security Mode Available:
auto-allocator = { version = "*", features = ["secure"] }
Structs§
- Allocator
Info - Allocator information structure
- Runtime
Allocator - System
Info - System information structure
Enums§
- Allocator
Type - Memory allocator type enumeration
Functions§
- check_
allocator_ optimization - Check if current allocator is optimal for current environment
- format_
memory_ size - High-performance memory size formatting function
- get_
allocator_ info - Returns information about the automatically selected allocator
- get_
allocator_ type - Get current allocator type
- get_
recommended_ allocator - Get recommended allocator for current runtime environment