Zephyr Project API
3.3.0
A Scalable Open Source RTOS
|
#include <zephyr/ztest.h>
#include <kernel_internal.h>
#include <zephyr/irq_offload.h>
#include <zephyr/sys/multi_heap.h>
#include "test_mheap.h"
Macros | |
#define | STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | OVERFLOW_SIZE SIZE_MAX |
#define | NMEMB 8 |
#define | SIZE 16 |
#define | BOUNDS (NMEMB * SIZE) |
#define | N_MULTI_HEAPS 4 |
#define | MHEAP_BYTES 128 |
Functions | |
K_SEM_DEFINE (thread_sem, 0, 1) | |
K_THREAD_STACK_DEFINE (tstack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
static void | tIsr_malloc_and_free (void *data) |
static void | thread_entry (void *p1, void *p2, void *p3) |
ZTEST (mheap_api, test_mheap_malloc_free) | |
Test to demonstrate k_malloc() and k_free() API usage. More... | |
ZTEST (mheap_api, test_mheap_calloc) | |
Test to demonstrate k_calloc() API functionality. More... | |
ZTEST (mheap_api, test_k_aligned_alloc) | |
ZTEST (mheap_api, test_sys_heap_mem_pool_assign) | |
Validate allocation and free from system heap memory pool. More... | |
ZTEST (mheap_api, test_malloc_in_isr) | |
Validate allocation and free from system heap memory pool in isr context. More... | |
ZTEST (mheap_api, test_malloc_in_thread) | |
Validate allocation and free failure when thread's resource pool is not assigned. More... | |
void * | multi_heap_choice (struct sys_multi_heap *mheap, void *cfg, size_t align, size_t size) |
ZTEST (mheap_api, test_multi_heap) | |
Variables | |
static struct sys_multi_heap | multi_heap |
static char | heap_mem [4][128] |
static struct sys_heap | mheaps [4] |
struct k_thread | tdata |
#define MHEAP_BYTES 128 |
#define N_MULTI_HEAPS 4 |
#define NMEMB 8 |
#define OVERFLOW_SIZE SIZE_MAX |
#define SIZE 16 |
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
K_SEM_DEFINE | ( | thread_sem | , |
0 | , | ||
1 | |||
) |
K_THREAD_STACK_DEFINE | ( | tstack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
void * multi_heap_choice | ( | struct sys_multi_heap * | mheap, |
void * | cfg, | ||
size_t | align, | ||
size_t | size | ||
) |
|
static |
|
static |
ZTEST | ( | mheap_api | , |
test_k_aligned_alloc | |||
) |
ZTEST | ( | mheap_api | , |
test_multi_heap | |||
) |
|
static |
|
static |
|
static |
struct k_thread tdata |