AP_HAL_SITL: switched ENABLE_HEAP to an #if

This commit is contained in:
Andrew Tridgell 2024-07-06 09:05:51 +10:00 committed by Peter Barker
parent 3980cbbb82
commit 393cd3252b
2 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ bool HALSITL::Util::get_system_id(char buf[50])
return get_system_id_unformatted((uint8_t *)buf, len); return get_system_id_unformatted((uint8_t *)buf, len);
} }
#ifdef ENABLE_HEAP #if ENABLE_HEAP
void *HALSITL::Util::allocate_heap_memory(size_t size) void *HALSITL::Util::allocate_heap_memory(size_t size)
{ {
struct heap *new_heap = (struct heap*)malloc(sizeof(struct heap)); struct heap *new_heap = (struct heap*)malloc(sizeof(struct heap));

View File

@ -43,7 +43,7 @@ public:
bool get_system_id_unformatted(uint8_t buf[], uint8_t &len) override; bool get_system_id_unformatted(uint8_t buf[], uint8_t &len) override;
void dump_stack_trace(); void dump_stack_trace();
#ifdef ENABLE_HEAP #if ENABLE_HEAP
// heap functions, note that a heap once alloc'd cannot be dealloc'd // heap functions, note that a heap once alloc'd cannot be dealloc'd
void *allocate_heap_memory(size_t size) override; void *allocate_heap_memory(size_t size) override;
void *heap_realloc(void *heap, void *ptr, size_t old_size, size_t new_size) override; void *heap_realloc(void *heap, void *ptr, size_t old_size, size_t new_size) override;
@ -90,7 +90,7 @@ private:
static ToneAlarm_SF _toneAlarm; static ToneAlarm_SF _toneAlarm;
#endif #endif
#ifdef ENABLE_HEAP #if ENABLE_HEAP
struct heap_allocation_header { struct heap_allocation_header {
size_t allocation_size; // size of allocated block, not including this header size_t allocation_size; // size of allocated block, not including this header
}; };