Home
last modified time | relevance | path

Searched refs:heap (Results 1 – 25 of 55) sorted by relevance

123

/Zephyr-Core-2.7.6/tests/lib/heap/src/
Dmain.c142 struct sys_heap heap; in test_small_heap() local
147 sys_heap_init(&heap, heapmem, SMALL_HEAP_SZ); in test_small_heap()
148 zassert_true(sys_heap_validate(&heap), ""); in test_small_heap()
149 sys_heap_stress(testalloc, testfree, &heap, in test_small_heap()
170 struct sys_heap heap; in test_fragmentation() local
176 sys_heap_init(&heap, heapmem, SMALL_HEAP_SZ); in test_fragmentation()
177 zassert_true(sys_heap_validate(&heap), ""); in test_fragmentation()
178 sys_heap_stress(testalloc, testfree, &heap, in test_fragmentation()
193 struct sys_heap heap; in test_big_heap() local
198 sys_heap_init(&heap, heapmem, BIG_HEAP_SZ); in test_big_heap()
[all …]
/Zephyr-Core-2.7.6/include/sys/
Dsys_heap.h52 struct z_heap *heap; member
72 void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes);
91 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes);
106 void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes);
121 void sys_heap_free(struct sys_heap *heap, void *mem);
146 void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr,
149 #define sys_heap_realloc(heap, ptr, bytes) \ argument
150 sys_heap_aligned_realloc(heap, ptr, 0, bytes)
165 bool sys_heap_validate(struct sys_heap *heap);
212 void sys_heap_print_info(struct sys_heap *heap, bool dump_chunks);
/Zephyr-Core-2.7.6/tests/lib/heap_align/src/
Dmain.c62 struct sys_heap heap = {}; in test_aligned_alloc() local
65 sys_heap_init(&heap, heapmem, HEAP_SZ); in test_aligned_alloc()
67 p = sys_heap_alloc(&heap, 1); in test_aligned_alloc()
69 sys_heap_free(&heap, p); in test_aligned_alloc()
80 check_heap_align(&heap, prefix, align, size); in test_aligned_alloc()
86 p = sys_heap_aligned_alloc(&heap, 8, 12); in test_aligned_alloc()
88 zassert_true(sys_heap_validate(&heap), "heap invalid"); in test_aligned_alloc()
89 sys_heap_free(&heap, p); in test_aligned_alloc()
92 p = sys_heap_aligned_alloc(&heap, 16, 16); in test_aligned_alloc()
93 q = sys_heap_aligned_alloc(&heap, 16, 17); in test_aligned_alloc()
[all …]
/Zephyr-Core-2.7.6/kernel/
Dmempool.c12 static void *z_heap_aligned_alloc(struct k_heap *heap, size_t align, size_t size) in z_heap_aligned_alloc() argument
29 mem = k_heap_aligned_alloc(heap, __align, size, K_NO_WAIT); in z_heap_aligned_alloc()
35 *heap_ref = heap; in z_heap_aligned_alloc()
127 struct k_heap *heap; in z_thread_aligned_alloc() local
130 heap = _SYSTEM_HEAP; in z_thread_aligned_alloc()
132 heap = _current->resource_pool; in z_thread_aligned_alloc()
135 if (heap != NULL) { in z_thread_aligned_alloc()
136 ret = z_heap_aligned_alloc(heap, align, size); in z_thread_aligned_alloc()
Dkheap.c16 sys_heap_init(&h->heap, mem, bytes); in k_heap_init()
41 lnkr_is_region_pinned((uint8_t *)h->heap.init_mem, in statics_init()
42 h->heap.init_bytes)) { in statics_init()
49 k_heap_init(h, h->heap.init_mem, h->heap.init_bytes); in statics_init()
78 ret = sys_heap_aligned_alloc(&h->heap, align, bytes); in k_heap_aligned_alloc()
122 sys_heap_free(&h->heap, mem); in k_heap_free()
/Zephyr-Core-2.7.6/doc/reference/kernel/memory/
Dheap.rst15 The simplest way to define a heap is statically, with the
26 Memory can be allocated from a heap using :c:func:`k_heap_alloc`,
27 passing it the address of the heap object and the number of bytes
31 The heap supports blocking operation, allowing threads to go to sleep
43 returned by :c:func:`k_heap_alloc` for the same heap. Freeing a
56 functions on a single heap must be serialized by the caller.
71 The heap code takes reasonable care to avoid fragmentation. Free
76 allocations are freed and added to the heap, they are automatically
80 heap memory, including the variable-length list of bucket list heads
81 (which depend on heap size). The only external memory required is the
[all …]
/Zephyr-Core-2.7.6/lib/os/
Dheap.c142 void sys_heap_free(struct sys_heap *heap, void *mem) in sys_heap_free() argument
147 struct z_heap *h = heap->heap; in sys_heap_free()
222 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes) in sys_heap_alloc() argument
224 struct z_heap *h = heap->heap; in sys_heap_alloc()
246 void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes) in sys_heap_aligned_alloc() argument
248 struct z_heap *h = heap->heap; in sys_heap_aligned_alloc()
264 return sys_heap_alloc(heap, bytes); in sys_heap_aligned_alloc()
313 void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr, in sys_heap_aligned_realloc() argument
316 struct z_heap *h = heap->heap; in sys_heap_aligned_realloc()
320 return sys_heap_aligned_alloc(heap, align, bytes); in sys_heap_aligned_realloc()
[all …]
DKconfig25 bool "Enable internal heap validity checking"
29 modifying the heap code or (maybe) when running in
34 int "Number of tries in the inner heap allocation loop"
40 Setting this to a high level will cause the heap to return
46 keeps the maximum runtime at a tight bound so that the heap
DCMakeLists.txt23 heap.c
24 heap-validate.c
Dheap-validate.c70 bool sys_heap_validate(struct sys_heap *heap) in sys_heap_validate() argument
72 struct z_heap *h = heap->heap; in sys_heap_validate()
385 void sys_heap_print_info(struct sys_heap *heap, bool dump_chunks) in sys_heap_print_info() argument
387 heap_print_info(heap->heap, dump_chunks); in sys_heap_print_info()
/Zephyr-Core-2.7.6/subsys/tracing/user/
Dtracing_user.h35 #define sys_port_trace_k_thread_heap_assign(thread, heap) argument
263 #define sys_port_trace_k_heap_init(heap) argument
264 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout) argument
265 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout) argument
266 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret) argument
267 #define sys_port_trace_k_heap_alloc_enter(heap, timeout) argument
268 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret) argument
269 #define sys_port_trace_k_heap_free(heap) argument
270 #define sys_port_trace_k_heap_sys_k_aligned_alloc_enter(heap) argument
271 #define sys_port_trace_k_heap_sys_k_aligned_alloc_exit(heap, ret) argument
[all …]
/Zephyr-Core-2.7.6/subsys/tracing/ctf/
Dtracing_ctf.h30 #define sys_port_trace_k_thread_heap_assign(thread, heap) argument
282 #define sys_port_trace_k_heap_init(heap) argument
283 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout) argument
284 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout) argument
285 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret) argument
286 #define sys_port_trace_k_heap_alloc_enter(heap, timeout) argument
287 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret) argument
288 #define sys_port_trace_k_heap_free(heap) argument
289 #define sys_port_trace_k_heap_sys_k_aligned_alloc_enter(heap) argument
290 #define sys_port_trace_k_heap_sys_k_aligned_alloc_exit(heap, ret) argument
[all …]
/Zephyr-Core-2.7.6/subsys/tracing/sysview/
Dtracing_sysview.h181 #define sys_port_trace_k_thread_heap_assign(thread, heap) argument
673 #define sys_port_trace_k_heap_init(heap) \ argument
674 SEGGER_SYSVIEW_RecordU32(TID_HEAP_INIT, (uint32_t)(uintptr_t)heap)
676 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout) \ argument
677 SEGGER_SYSVIEW_RecordU32x2(TID_HEAP_ALIGNED_ALLOC, (uint32_t)(uintptr_t)heap, \
680 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout) argument
682 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret) \ argument
685 #define sys_port_trace_k_heap_alloc_enter(heap, timeout) \ argument
686 SEGGER_SYSVIEW_RecordU32x2(TID_HEAP_ALLOC, (uint32_t)(uintptr_t)heap, \
689 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret) \ argument
[all …]
DSYSVIEW_Zephyr.txt85 76 k_heap_init heap=%I, mem=%p, bytes=%u
86 77 k_heap_alloc heap=%I, bytes=%u, Timeout=%TimeOut | Returns %p
87 78 k_heap_free heap=%I, mem=%p
88 79 k_heap_aligned_alloc heap=%I
/Zephyr-Core-2.7.6/include/tracing/
Dtracing.h1769 #define sys_port_trace_k_heap_sys_k_aligned_alloc_enter(heap) argument
1776 #define sys_port_trace_k_heap_sys_k_aligned_alloc_exit(heap, ret) argument
1782 #define sys_port_trace_k_heap_sys_k_malloc_enter(heap) argument
1789 #define sys_port_trace_k_heap_sys_k_malloc_exit(heap, ret) argument
1795 #define sys_port_trace_k_heap_sys_k_free_enter(heap) argument
1801 #define sys_port_trace_k_heap_sys_k_free_exit(heap) argument
1807 #define sys_port_trace_k_heap_sys_k_calloc_enter(heap) argument
1814 #define sys_port_trace_k_heap_sys_k_calloc_exit(heap, ret) argument
/Zephyr-Core-2.7.6/lib/libc/
DKconfig68 int "Maximum memory mapped for newlib heap"
73 will be used for the newlib malloc() heap. The actual amount of
78 int "Newlib minimum required heap size"
83 newlib heap. An assertion failure message will be displayed during
84 initialization if the memory space available for the newlib heap is
88 int "Newlib aligned heap size"
95 and user mode threads need to access this heap, then this is necessary
96 to properly define an MPU region for the heap.
/Zephyr-Core-2.7.6/modules/mbedtls/
DKconfig76 twice this value will be allocated (on mbedTLS own heap, so the
130 bool "Enable global heap for mbed TLS"
132 This option enables the mbedtls to use the heap. This setting must
134 try to do this themselves as there can be only one heap defined
136 startup, initialize the heap automatically.
144 The mbedtls routines will use this heap if enabled.
148 Default value for the heap size is not set as it depends on the
160 about mbed TLS library, such as heap usage.
Dshell.c54 SHELL_CMD_ARG(heap, &mbedtls_heap_cmds, "Show heap status",
/Zephyr-Core-2.7.6/subsys/tracing/test/
Dtracing_test.h21 #define sys_port_trace_k_thread_heap_assign(thread, heap) \ argument
22 sys_trace_k_thread_heap_assign(thread, heap)
377 #define sys_port_trace_k_heap_sys_k_aligned_alloc_enter(heap) \ argument
378 sys_trace_k_heap_sys_k_aligned_alloc_enter(heap, align, size)
379 #define sys_port_trace_k_heap_sys_k_aligned_alloc_exit(heap, ret) \ argument
380 sys_trace_k_heap_sys_k_aligned_alloc_exit(heap, align, size, ret)
381 #define sys_port_trace_k_heap_sys_k_malloc_enter(heap) \ argument
382 sys_trace_k_heap_sys_k_malloc_enter(heap, size)
383 #define sys_port_trace_k_heap_sys_k_malloc_exit(heap, ret) \ argument
384 sys_trace_k_heap_sys_k_malloc_exit(heap, size, ret)
[all …]
/Zephyr-Core-2.7.6/include/kernel/
Dmempool_heap.h18 struct k_heap *heap; member
/Zephyr-Core-2.7.6/tests/benchmarks/latency_measure/
DREADME.rst18 * Measure average time to alloc memory from heap then free that memory
41 Average time for heap malloc : 13056 cycles , 13056 ns
42 Average time for heap free : 7776 cycles , 7776 ns
/Zephyr-Core-2.7.6/tests/lib/heap/
DCMakeLists.txt5 project(heap) project
/Zephyr-Core-2.7.6/soc/arm/cypress/psoc6/
Dnoinit.ld14 KEEP(*(.heap))
/Zephyr-Core-2.7.6/subsys/fs/
DKconfig.littlefs84 positive value for the heap size. Be aware that there is a
86 present in the heap.
88 If this option is set to a non-positive value the heap is sized to
/Zephyr-Core-2.7.6/boards/arm/mimxrt685_evk/
DKconfig.defconfig33 # Memory from the heap pool is used to allocate DMA descriptors for

123