From 0c691bf2e59bbcada8d0b2e64a8f7ff806797fc8 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 8 Dec 2023 15:41:18 +0200 Subject: [PATCH] Zephyr integration: Use K_HEAP_MEM_POOL_SIZE This define should be used instead of the Kconfig option to determine if the k_malloc family of functions are available. Signed-off-by: Johan Hedberg --- lib/system/zephyr/alloc.c | 4 ++-- lib/system/zephyr/alloc.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/system/zephyr/alloc.c b/lib/system/zephyr/alloc.c index 8e4e974f..da70e0ca 100644 --- a/lib/system/zephyr/alloc.c +++ b/lib/system/zephyr/alloc.c @@ -12,7 +12,7 @@ #include #include -#if (CONFIG_HEAP_MEM_POOL_SIZE <= 0) +#if (K_HEAP_MEM_POOL_SIZE <= 0) void *metal_weak metal_zephyr_allocate_memory(unsigned int size) { @@ -25,4 +25,4 @@ void metal_weak metal_zephyr_free_memory(void *ptr) (void)ptr; } -#endif /* CONFIG_HEAP_MEM_POOL_SIZE */ +#endif /* K_HEAP_MEM_POOL_SIZE */ diff --git a/lib/system/zephyr/alloc.h b/lib/system/zephyr/alloc.h index 075fa5b9..0064a53a 100644 --- a/lib/system/zephyr/alloc.h +++ b/lib/system/zephyr/alloc.h @@ -23,7 +23,7 @@ extern "C" { #endif -#if (CONFIG_HEAP_MEM_POOL_SIZE > 0) +#if (K_HEAP_MEM_POOL_SIZE > 0) static inline void *__metal_allocate_memory(unsigned int size) { return k_malloc(size); @@ -47,7 +47,7 @@ static inline void __metal_free_memory(void *ptr) { metal_zephyr_free_memory(ptr); } -#endif /* CONFIG_HEAP_MEM_POOL_SIZE */ +#endif /* K_HEAP_MEM_POOL_SIZE */ #ifdef __cplusplus