define option to disable cpp allocation overrides (#1145) Setting `PICO_CXX_DISABLE_ALLOCATION_OVERRIDES=1` will prevent `new` etc. operators being overridden
diff --git a/src/rp2_common/pico_standard_link/new_delete.cpp b/src/rp2_common/pico_standard_link/new_delete.cpp index c122dc0..6d632e2 100644 --- a/src/rp2_common/pico_standard_link/new_delete.cpp +++ b/src/rp2_common/pico_standard_link/new_delete.cpp
@@ -4,9 +4,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#if !PICO_CXX_ENABLE_EXCEPTIONS +#if !PICO_CXX_ENABLE_EXCEPTIONS // Override the standard allocators to use regular malloc/free +#if !PICO_CXX_DISABLE_ALLOCATION_OVERRIDES // Let user override #include <cstdlib> void *operator new(std::size_t n) { @@ -30,3 +31,5 @@ #endif #endif + +#endif