src/bare-metal/alloc.md
allocTo use alloc you must implement a
global (heap) allocator.
# // Copyright 2023 Google LLC
# // SPDX-License-Identifier: Apache-2.0
#
{{#include alloc-example/src/main.rs:Alloc}}
buddy_system_allocator is a crate implementing a basic buddy system
allocator. Other crates are available, or you can write your own or hook into
your existing allocator.LockedHeap is the max order of the allocator; i.e. in
this case it can allocate regions of up to 2**32 bytes.alloc then you must have
exactly one global allocator defined in your binary. Usually this is done in
the top-level binary crate.extern crate panic_halt as _ is necessary to ensure that the panic_halt
crate is linked in so we get its panic handler.