6#ifndef ZEPHYR_INCLUDE_SYS_SYS_HEAP_H_
7#define ZEPHYR_INCLUDE_SYS_SYS_HEAP_H_
57struct z_heap_stress_result {
64#ifdef CONFIG_SYS_HEAP_RUNTIME_STATS
66struct sys_heap_runtime_stats {
68 size_t allocated_bytes;
78int sys_heap_runtime_stats_get(
struct sys_heap *heap,
79 struct sys_heap_runtime_stats *stats);
166 size_t align,
size_t bytes);
168#define sys_heap_realloc(heap, ptr, bytes) \
169 sys_heap_aligned_realloc(heap, ptr, 0, bytes)
216 void (*free_fn)(
void *arg,
void *
p),
217 void *arg,
size_t total_bytes,
219 void *scratch_mem,
size_t scratch_bytes,
221 struct z_heap_stress_result *
result);
struct k_pipe p
Definition: kobject.c:1311
void * ptr
Definition: printk.c:79
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
Definition: sys_heap.h:51
size_t init_bytes
Definition: sys_heap.h:54
struct z_heap * heap
Definition: sys_heap.h:52
void * init_mem
Definition: sys_heap.h:53
void * sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr, size_t align, size_t bytes)
Expand the size of an existing allocation.
void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes)
Initialize sys_heap.
void * sys_heap_alloc(struct sys_heap *heap, size_t bytes)
Allocate memory from a sys_heap.
void * sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes)
Allocate aligned memory from a sys_heap.
bool sys_heap_validate(struct sys_heap *heap)
Validate heap integrity.
void sys_heap_free(struct sys_heap *heap, void *mem)
Free memory into a sys_heap.
void sys_heap_stress(void *(*alloc_fn)(void *arg, size_t bytes), void(*free_fn)(void *arg, void *p), void *arg, size_t total_bytes, uint32_t op_count, void *scratch_mem, size_t scratch_bytes, int target_percent, struct z_heap_stress_result *result)
sys_heap stress test rig
void sys_heap_print_info(struct sys_heap *heap, bool dump_chunks)
Print heap internal structure information to the console.