Expand description
Provides a global allocator using the umm_malloc library.
You must call umm_malloc::init_heap()
exactly once
before allocating anything using the global memory allocator.
All allocations from this allocator are aligned by 8 bytes. Requesting a larger alignment is not implemented and will panic.
§Global Allocator Critical Sections
Concurrent access to the global allocator is Undefined Behavior. Enable only one of the following cargo features to configure how access to the global allocator is controlled.
cortex-m-interrupt-critical-section
: interrupt-disabled critical section for ARM Cortex-M processors.extern-critical-section
: Uses the extern functionsvoid _umm_critical_entry(uint32_t*)
andvoid _umm_critical_exit(uint32_t*)
to implement the global allocator critical sections. You MUST supply those functions via some other means. Note that critical sections may nest.unsafe-no-critical-section
: no critical sections around the global allocator. You MUST prevent concurrent use of the global allcator to avoid Undefined Behavior.
Constants§
- MIN_
ALIGN - All allocations from this allocator are aligned to
MIN_ALIGN
. Alignments larger thanMIN_ALIGN
are currently not supported. Callingalloc()
orrealloc()
with alayout
requesting a larger alignment will panic.