Custom heap is BPF only (#13537)

This commit is contained in:
Jack May
2020-11-11 16:37:18 -08:00
committed by GitHub
parent 2cb9ca5966
commit 2374664e95

View File

@ -45,7 +45,10 @@ pub const HEAP_LENGTH: usize = 32 * 1024;
#[macro_export]
macro_rules! entrypoint {
($process_instruction:ident) => {
#[cfg(all(not(feature = "custom-heap"), not(test)))]
/// A program can provide their own custom heap implementation by adding
/// a `custom-heap` feature to `Cargo.toml` and implementing their own
/// `global_allocator`.
#[cfg(all(not(feature = "custom-heap"), target_arch = "bpf"))]
#[global_allocator]
static A: $crate::entrypoint::BumpAllocator = $crate::entrypoint::BumpAllocator {
start: $crate::entrypoint::HEAP_START_ADDRESS,