From 2374664e95f5f45ceccb132848184b9ec2bff77d Mon Sep 17 00:00:00 2001 From: Jack May Date: Wed, 11 Nov 2020 16:37:18 -0800 Subject: [PATCH] Custom heap is BPF only (#13537) --- sdk/program/src/entrypoint.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/program/src/entrypoint.rs b/sdk/program/src/entrypoint.rs index 5d979db348..588cb65b0e 100644 --- a/sdk/program/src/entrypoint.rs +++ b/sdk/program/src/entrypoint.rs @@ -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,