Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zephyr integration: Use K_HEAP_MEM_POOL_SIZE #280

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <johan.hedberg@intel.com>
  • Loading branch information
Johan Hedberg committed Dec 14, 2023
commit 0c691bf2e59bbcada8d0b2e64a8f7ff806797fc8
4 changes: 2 additions & 2 deletions lib/system/zephyr/alloc.c
Original file line number Diff line number Diff line change
@@ -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)
{
@@ -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
@@ -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