18#include "pw_allocator/allocator.h"
19#include "pw_bytes/span.h"
20#include "pw_malloc/config.h"
21#include "pw_preprocessor/util.h"
34void InitSystemAllocator(ByteSpan heap);
45void InitSystemAllocator(
void* heap_low_addr,
void* heap_high_addr);
54template <
typename AllocatorType>
55void InitSystemAllocator(ByteSpan heap);
64void pw_MallocInit(uint8_t* heap_low_addr, uint8_t* heap_high_addr);
85Allocator* GetSystemAllocator();
88const PW_MALLOC_METRICS_TYPE& GetSystemMetrics();
92template <
typename AllocatorType>
93void InitSystemAllocator(ByteSpan heap) {
94 static bool initialized =
false;
95 PW_ASSERT(!initialized);
96 auto* allocator =
static_cast<AllocatorType*
>(GetSystemAllocator());
97 allocator->Init(heap);