Skip to content

Commit ea80024

Browse files
committed
Arm backend: Make memory pool sizes configrable from cmake
Signed-off-by: Zingo Andersen <[email protected]> Change-Id: Ic91c81f4ab2c0c97a81f948246d02149e1006656
1 parent 92d1d1e commit ea80024

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ cmake_minimum_required(VERSION 3.20)
77
project(arm_executor_runner)
88

99
option(SEMIHOSTING "Enable semihosting" OFF)
10+
option(ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE "Set ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE to specify memory alloction pool size" OFF)
11+
option(ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE "Set ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE to specify temp alloction pool size" OFF)
12+
1013

1114
if(NOT DEFINED ET_PTE_FILE_PATH AND NOT ${SEMIHOSTING})
1215
message(
@@ -172,6 +175,14 @@ else()
172175
add_dependencies(arm_executor_runner gen_model_header)
173176
endif()
174177

178+
if(ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE)
179+
target_compile_definitions(arm_executor_runner PUBLIC ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE=${ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE})
180+
endif()
181+
182+
if(ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE)
183+
target_compile_definitions(arm_executor_runner PUBLIC ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE=${ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE})
184+
endif()
185+
175186
# Fixup compilation of retarget.c
176187
if(SEMIHOSTING)
177188
# Remove this when MLBEDSW-8910 is closed.

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ int main(int argc, const char* argv[]) {
392392
(unsigned int)method_meta.error());
393393
}
394394

395+
ET_LOG(
396+
Info,
397+
"Setup Method allocator pool. Size: %lu bytes.",
398+
method_allocation_pool_size);
399+
395400
ArmMemoryAllocator method_allocator(
396401
method_allocation_pool_size, method_allocation_pool);
397402

0 commit comments

Comments
 (0)