From 64f6abd4d43e4c4c21b5b94f867fc5c9851ec201 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 6 Jul 2024 09:05:51 +1000 Subject: [PATCH] AP_HAL_ChibiOS: switched ENABLE_HEAP to an #if --- libraries/AP_HAL_ChibiOS/Util.cpp | 2 +- libraries/AP_HAL_ChibiOS/Util.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/Util.cpp b/libraries/AP_HAL_ChibiOS/Util.cpp index 88db69e689..6775192d2a 100644 --- a/libraries/AP_HAL_ChibiOS/Util.cpp +++ b/libraries/AP_HAL_ChibiOS/Util.cpp @@ -96,7 +96,7 @@ void Util::free_type(void *ptr, size_t size, AP_HAL::Util::Memory_Type mem_type) } -#ifdef ENABLE_HEAP +#if ENABLE_HEAP void *Util::allocate_heap_memory(size_t size) { diff --git a/libraries/AP_HAL_ChibiOS/Util.h b/libraries/AP_HAL_ChibiOS/Util.h index 1df3e32c76..f11dbf7239 100644 --- a/libraries/AP_HAL_ChibiOS/Util.h +++ b/libraries/AP_HAL_ChibiOS/Util.h @@ -48,7 +48,7 @@ public: void *malloc_type(size_t size, AP_HAL::Util::Memory_Type mem_type) override; void free_type(void *ptr, size_t size, AP_HAL::Util::Memory_Type mem_type) override; -#ifdef ENABLE_HEAP +#if ENABLE_HEAP // heap functions, note that a heap once alloc'd cannot be dealloc'd virtual void *allocate_heap_memory(size_t size) override; virtual void *heap_realloc(void *heap, void *ptr, size_t old_size, size_t new_size) override; @@ -142,7 +142,7 @@ private: FlashBootloader flash_bootloader() override; #endif -#ifdef ENABLE_HEAP +#if ENABLE_HEAP static memory_heap_t scripting_heap; #endif // ENABLE_HEAP