Cargo Features

umm-malloc has no features set by default.

[dependencies]
umm-malloc = { version = "0.3.2", features = ["unsafe-no-critical-section", "extern-critical-section", "cortex-m-interrupt-critical-section", "first-fit", "init-if-uninitialized", "hang-if-uninitialized", "enable-pie"] }
unsafe-no-critical-section

Disables critical sections around the global allocator. You MUST ensure the global allocator is not accessed concurrently through some other means.

extern-critical-section

Use the extern functions _umm_critical_entry() and _umm_critical_exit() to implement the global allocator critical sections. You MUST supply those functions via some other means. Note that critical sections may nest.

Enables extern-critical-section of umm-malloc-sys

cortex-m-interrupt-critical-section

Add critical sections around allocator internals, by disabling and re-enabling interrupts when necessary.

Enables cortex-m-interrupt-critical-section of umm-malloc-sys

first-fit

Use the first available block for allocation, rather than search for a better fit.

Enables first-fit of umm-malloc-sys

init-if-uninitialized

Every umm_malloc function checks if the heap is initialized. If the heap is not initialized, it tries to initialize it with UMM_MALLOC_CFG_HEAP_ADDR and UMM_MALLOC_CFG_HEAP_SIZE.

Enables init-if-uninitialized of umm-malloc-sys

hang-if-uninitialized

Every umm_malloc function checks if the heap is initialized. If the heap is not initialized, it loops forever.

Enables hang-if-uninitialized of umm-malloc-sys

enable-pie

Compile the umm_malloc C code position independent (-fPIE). You'll likely want to enable it for rustc also e.g. -C relocation-model=pie.

Enables enable-pie of umm-malloc-sys