mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 16:23:56 -04:00
AP_HAL: ensure libc realloc is available for all platforms except ChibiOS
This commit is contained in:
parent
f163448298
commit
cf0c6d3247
@ -232,3 +232,7 @@
|
||||
#else
|
||||
#define AP_UAVCAN_SLCAN_ENABLED 0
|
||||
#endif
|
||||
|
||||
#ifndef USE_LIBC_REALLOC
|
||||
#define USE_LIBC_REALLOC 1
|
||||
#endif
|
||||
|
@ -151,7 +151,11 @@ public:
|
||||
// heap functions, note that a heap once alloc'd cannot be dealloc'd
|
||||
virtual void *allocate_heap_memory(size_t size) = 0;
|
||||
virtual void *heap_realloc(void *heap, void *ptr, size_t new_size) = 0;
|
||||
#if USE_LIBC_REALLOC
|
||||
virtual void *std_realloc(void *ptr, size_t new_size) { return realloc(ptr, new_size); }
|
||||
#else
|
||||
virtual void *std_realloc(void *ptr, size_t new_size) = 0;
|
||||
#endif // USE_LIBC_REALLOC
|
||||
#endif // ENABLE_HEAP
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user