Skip to content

Commit

Permalink
Zephyr integration: Use K_HEAP_MEM_POOL_SIZE
Browse files Browse the repository at this point in the history
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 <johan.hedberg@intel.com>
  • Loading branch information
Johan Hedberg committed Dec 14, 2023
1 parent f3f365d commit 0c691bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/system/zephyr/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <metal/alloc.h>
#include <metal/compiler.h>

#if (CONFIG_HEAP_MEM_POOL_SIZE <= 0)
#if (K_HEAP_MEM_POOL_SIZE <= 0)

void *metal_weak metal_zephyr_allocate_memory(unsigned int size)
{
Expand All @@ -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 */
4 changes: 2 additions & 2 deletions lib/system/zephyr/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 0c691bf

Please sign in to comment.