kernel: heap: Add support for CONFIG_MULTITHREADING=n

Ensure that k_heap is not attempt to block the thread when
timeout is set and space cannot be allocated.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-04-19 10:52:34 +02:00 committed by Carles Cufí
commit c482a572d4
2 changed files with 6 additions and 3 deletions

View file

@ -4841,7 +4841,7 @@ extern int k_mem_slab_init(struct k_mem_slab *slab, void *buffer,
* This routine allocates a memory block from a memory slab.
*
* @note @a timeout must be set to K_NO_WAIT if called from ISR.
* @note When CONFIG_MULTITHREADING=n any @timeout is treated as K_NO_WAIT.
* @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
*
* @funcprops \isr_ok
*
@ -4962,6 +4962,7 @@ void k_heap_init(struct k_heap *h, void *mem, size_t bytes);
* k_heap_free().
*
* @note @a timeout must be set to K_NO_WAIT if called from ISR.
* @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
*
* @funcprops \isr_ok
*
@ -4985,6 +4986,7 @@ void *k_heap_aligned_alloc(struct k_heap *h, size_t align, size_t bytes,
* the timeout, NULL will be returned.
*
* @note @a timeout must be set to K_NO_WAIT if called from ISR.
* @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
*
* @funcprops \isr_ok
*