Registry / utility / alloc-cortex-m

alloc-cortex-m

JSON →
library0.4.4rscratesunverified

A heap allocator for Cortex-M processors, enabling dynamic memory allocation in embedded systems.

# Cargo.toml [dependencies] alloc-cortex-m = "0.4.4"
INSTALL
IMPORT
SIG · ALLOC-CORTEX-M
A
alloc-cortex-m
utilityrustv0.4.4
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.

CortexMHeap
use alloc_cortex_m::CortexMHeap;

Initialize and use the Cortex-M heap allocator.

use alloc_cortex_m::CortexMHeap; use core::alloc::Layout; #[global_allocator] static ALLOCATOR: CortexMHeap = CortexMHeap::empty(); fn main() { unsafe { ALLOCATOR.init(0x20000000, 0x1000); } let _box = Box::new(42); println!("Allocated!"); }
Debug
Known issues
gotchaRequires careful memory region setup; incorrect base/size can cause crashes.
fix
Ensure the memory region is valid and not used elsewhere.
affects: *
Upgrade
Version history
0.4.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
20
Meta
1
OpenAI (training)
1
Resources
alloc-cortex-m — cargo add alloc-cortex-m · libregistry