Talc
A fast and flexible allocator for no_std and WebAssembly
Install / Use
/learn @SFBdragon/TalcREADME
Talc Dynamic Memory Allocator
<sub><i>If you find Talc useful, please consider leaving tip via Paypal or Ko-Fi</i></sub>
What is this for?
- Embedded systems, OS kernels, and other
no_stdenvironments - WebAssembly modules, as a drop-in replacement for DLmalloc
Why Talc?
Performance:
- Fast & Efficient: Benchmarks (Linux x86_64)
- Fast & Small: WebAssembly Benchmarks
Features:
- Safe, lockless
TalcCellfor single-threaded allocation withGlobalAllocandAllocator - Flexible locking using
lock_apifor multi-threaded allocation usingTalcLock - Supports
allocator-api2for using theAllocatorAPI in safe Rust "counters": Provides allocation statistics for debugging and performance insights- Supports creating and resizing arbitrarily many heaps, manually or automatically
- Supports automatic reclaim of unused memory
- Correctness verified with tests, MIRI, and fuzzing
Why not Talc?
If you're on a mature hosted system, especially one that jemalloc or mimalloc supports, consider those instead.
Those provide allocation concurrency, well-tested virtual memory API integration,
and are all-round more mature and sophisticated and more cleverly implemented than Talc.
Even the default allocator for Rust on Linux, for example, has impressive performance characteristics.
