Registry / utility / embedded-alloc

embedded-alloc

JSON →
library0.7.0rscratesunverified

A heap allocator for embedded systems.

# Cargo.toml [dependencies] embedded-alloc = "0.7.0"
INSTALL
IMPORT
SIG · EMBEDDED-ALLOC
E
embedded-alloc
utilityrustv0.7.0
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.

Heap
use embedded_alloc::Heap;

Initializes a global heap allocator for embedded systems.

use embedded_alloc::Heap; #[global_allocator] static HEAP: Heap = Heap::empty(); fn main() { unsafe { HEAP.init(4096) } let _vec = vec![1, 2, 3]; println!("Allocated vector"); }
Debug
Known issues
gotchaRequires unsafe code to initialize the heap.
fix
Use unsafe { HEAP.init(size) } before any allocation.
affects: >=0.7.0
Upgrade
Version history
0.7.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
embedded-alloc — cargo add embedded-alloc · libregistry