Skip to main content

no_allocator

Macro no_allocator 

Source
macro_rules! no_allocator {
    () => { ... };
}
Expand description

A global allocator that does not dynamically allocate memory.

This macro sets up a global allocator that denies all dynamic allocations, while allowing static (“manual”) allocations. This is useful when the program does not need to dynamically allocate memory and manages their own allocations.

The program will panic if it tries to dynamically allocate memory.

This is used when the "alloc" feature is disabled.