Registry / other / linked-list-allocator

linked-list-allocator

JSON →
library0.10.6rscratesunverified

Simple allocator for no_std systems using a linked list of freed blocks.

# Cargo.toml [dependencies] linked_list_allocator = "0.10.6"
INSTALL
IMPORT
SIG · LINKED-LIST-ALLOCA
L
linked-list-allocator
otherrustv0.10.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LockedHeap
use linked_list_allocator::LockedHeap;

Initialize a global allocator with a fixed heap region.

use linked_list_allocator::LockedHeap; #[global_allocator] static ALLOCATOR: LockedHeap = LockedHeap::empty(); fn main() { let heap_start = 0x1000 as *mut u8; let heap_size = 4096; unsafe { ALLOCATOR.lock().init(heap_start, heap_size); } let _box = Box::new(42); }
Debug
Known issues
gotchaThe allocator is not thread-safe by default; use LockedHeap for global usage.
fix
Use `LockedHeap` (which wraps a spinlock) instead of `Heap` directly.
affects: >=0.10.0
Upgrade
Version history
0.10.6latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
linked-list-allocator — cargo add linked-list-allocator · libregistry