mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
define option to disable cpp allocation overrides (#1145)
Setting `PICO_CXX_DISABLE_ALLOCATION_OVERRIDES=1` will prevent `new` etc. operators being overridden
This commit is contained in:
parent
2a9c59925a
commit
c852a65ecc
1 changed files with 4 additions and 1 deletions
|
|
@ -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 @@ void operator delete[](void *p, __unused std::size_t n) noexcept { std::free(p);
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue