Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
test_mheap_api.c File Reference
#include <ztest.h>
#include <kernel_internal.h>
#include <irq_offload.h>
#include "test_mheap.h"

Macros

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define OVERFLOW_SIZE   SIZE_MAX
 
#define NMEMB   8
 
#define SIZE   16
 
#define BOUNDS   (NMEMB * SIZE)
 

Functions

 K_SEM_DEFINE (thread_sem, 0, 1)
 
 K_THREAD_STACK_DEFINE (tstack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
static void tIsr_malloc_and_free (void *data)
 
static void thread_entry (void *p1, void *p2, void *p3)
 
void test_mheap_malloc_free (void)
 Test to demonstrate k_malloc() and k_free() API usage. More...
 
void test_mheap_calloc (void)
 Test to demonstrate k_calloc() API functionality. More...
 
void test_k_aligned_alloc (void)
 
void test_sys_heap_mem_pool_assign (void)
 Validate allocation and free from system heap memory pool. More...
 
void test_malloc_in_isr (void)
 Validate allocation and free from system heap memory pool in isr context. More...
 
void test_malloc_in_thread (void)
 Validate allocation and free failure when thread's resource pool is not assigned. More...
 

Variables

struct k_thread tdata
 

Macro Definition Documentation

◆ BOUNDS

#define BOUNDS   (NMEMB * SIZE)

◆ NMEMB

#define NMEMB   8

◆ OVERFLOW_SIZE

#define OVERFLOW_SIZE   SIZE_MAX

◆ SIZE

#define SIZE   16

◆ STACK_SIZE

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ K_SEM_DEFINE()

K_SEM_DEFINE ( thread_sem  ,
,
 
)

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( tstack  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ test_k_aligned_alloc()

void test_k_aligned_alloc ( void  )

◆ thread_entry()

static void thread_entry ( void p1,
void p2,
void p3 
)
static

◆ tIsr_malloc_and_free()

static void tIsr_malloc_and_free ( void data)
static

Variable Documentation

◆ tdata

struct k_thread tdata