CPPMEM: Reduce fixed C++ heap to 1k.

Removing the use of std::map from LTP305's "dotfont" dramatically reduced init heap usage. Reduce the fixed buffer to account for this.
This commit is contained in:
Phil Howard 2023-03-27 13:40:04 +01:00
parent 049a121974
commit bad6a9e8d6
1 changed files with 5 additions and 1 deletions

View File

@ -9,12 +9,16 @@ enum allocator_mode {
MICROPYTHON
};
#ifndef CPP_FIXED_HEAP_SIZE
#define CPP_FIXED_HEAP_SIZE 1024u
#endif
static uint32_t alloc_bytes = 0;
static uint32_t alloc_count = 0;
static uint32_t free_count = 0;
static allocator_mode mode = FIXED_HEAP;
static constexpr size_t cpp_heap_size = 10 * 1024 / 4;
static constexpr size_t cpp_heap_size = CPP_FIXED_HEAP_SIZE / 4;
static uint32_t cpp_heap[cpp_heap_size];
static uint32_t ptr = 0;
static char cpp_err_buf[128] = {0};