Home
last modified time | relevance | path

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

123456

/Zephyr-latest/kernel/
Dkheap.c15 void k_heap_init(struct k_heap *heap, void *mem, size_t bytes) in k_heap_init() argument
17 z_waitq_init(&heap->wait_q); in k_heap_init()
18 sys_heap_init(&heap->heap, mem, bytes); in k_heap_init()
20 SYS_PORT_TRACING_OBJ_INIT(k_heap, heap); in k_heap_init()
25 STRUCT_SECTION_FOREACH(k_heap, heap) { in statics_init()
40 if (lnkr_is_pinned((uint8_t *)heap) && in statics_init()
41 lnkr_is_pinned((uint8_t *)&heap->wait_q) && in statics_init()
42 lnkr_is_region_pinned((uint8_t *)heap->heap.init_mem, in statics_init()
43 heap->heap.init_bytes)) { in statics_init()
50 k_heap_init(heap, heap->heap.init_mem, heap->heap.init_bytes); in statics_init()
[all …]
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()
119 struct k_heap *heap, **heap_ref; in k_realloc() local
131 heap = *heap_ref; in k_realloc()
133 SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_heap_sys, k_realloc, heap, ptr); in k_realloc()
136 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_heap_sys, k_realloc, heap, ptr, NULL); in k_realloc()
140 ret = k_heap_realloc(heap, ptr, size, K_NO_WAIT); in k_realloc()
147 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_heap_sys, k_realloc, heap, ptr, ret); in k_realloc()
163 struct k_heap *heap; in z_thread_aligned_alloc() local
[all …]
/Zephyr-latest/lib/heap/
Dheap_stats.c11 int sys_heap_runtime_stats_get(struct sys_heap *heap, in sys_heap_runtime_stats_get() argument
14 if ((heap == NULL) || (stats == NULL)) { in sys_heap_runtime_stats_get()
18 stats->free_bytes = heap->heap->free_bytes; in sys_heap_runtime_stats_get()
19 stats->allocated_bytes = heap->heap->allocated_bytes; in sys_heap_runtime_stats_get()
20 stats->max_allocated_bytes = heap->heap->max_allocated_bytes; in sys_heap_runtime_stats_get()
25 int sys_heap_runtime_stats_reset_max(struct sys_heap *heap) in sys_heap_runtime_stats_reset_max() argument
27 if (heap == NULL) { in sys_heap_runtime_stats_reset_max()
31 heap->heap->max_allocated_bytes = heap->heap->allocated_bytes; in sys_heap_runtime_stats_reset_max()
Dmulti_heap.c10 void sys_multi_heap_init(struct sys_multi_heap *heap, sys_multi_heap_fn_t choice_fn) in sys_multi_heap_init() argument
12 heap->nheaps = 0; in sys_multi_heap_init()
13 heap->choice = choice_fn; in sys_multi_heap_init()
17 struct sys_heap *heap, void *user_data) in sys_multi_heap_add_heap() argument
21 mheap->heaps[mheap->nheaps].heap = heap; in sys_multi_heap_add_heap()
31 uintptr_t haddr = (uintptr_t)mheap->heaps[j].heap->heap; in sys_multi_heap_add_heap()
70 haddr = (uintptr_t)mheap->heaps[i].heap->heap; in sys_multi_heap_get_heap()
86 const struct sys_multi_heap_rec *heap; in sys_multi_heap_free() local
88 heap = sys_multi_heap_get_heap(mheap, block); in sys_multi_heap_free()
90 if (heap != NULL) { in sys_multi_heap_free()
[all …]
DKconfig8 bool "Internal heap validity checking"
13 modifying the heap code or (maybe) when running in
20 bool "General purpose heap stress test"
22 Stresses the heap.
29 Enables support for printing heap internal structure
35 int "Number of tries in the inner heap allocation loop"
41 Setting this to a high level will cause the heap to return
47 keeps the maximum runtime at a tight bound so that the heap
51 bool "System heap runtime statistics"
53 Gather system heap runtime statistics.
[all …]
Dheap.c163 void sys_heap_free(struct sys_heap *heap, void *mem) in sys_heap_free() argument
168 struct z_heap *h = heap->heap; in sys_heap_free()
193 heap_listener_notify_free(HEAP_ID_FROM_POINTER(heap), mem, in sys_heap_free()
200 size_t sys_heap_usable_size(struct sys_heap *heap, void *mem) in sys_heap_usable_size() argument
202 struct z_heap *h = heap->heap; in sys_heap_usable_size()
263 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes) in sys_heap_alloc() argument
265 struct z_heap *h = heap->heap; in sys_heap_alloc()
293 heap_listener_notify_alloc(HEAP_ID_FROM_POINTER(heap), mem, in sys_heap_alloc()
301 void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes) in sys_heap_aligned_alloc() argument
303 struct z_heap *h = heap->heap; in sys_heap_aligned_alloc()
[all …]
Dheap_info.c73 void sys_heap_print_info(struct sys_heap *heap, bool dump_chunks) in sys_heap_print_info() argument
75 heap_print_info(heap->heap, dump_chunks); in sys_heap_print_info()
/Zephyr-latest/include/zephyr/sys/
Dsys_heap.h58 struct z_heap *heap; member
85 int sys_heap_runtime_stats_get(struct sys_heap *heap,
97 int sys_heap_runtime_stats_reset_max(struct sys_heap *heap);
109 void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes);
128 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes);
143 void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes);
158 void sys_heap_free(struct sys_heap *heap, void *mem);
178 void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr,
181 #define sys_heap_realloc(heap, ptr, bytes) \ argument
182 sys_heap_aligned_realloc(heap, ptr, 0, bytes)
[all …]
Dmulti_heap.h62 struct sys_heap *heap; member
93 void sys_multi_heap_init(struct sys_multi_heap *heap,
108 void sys_multi_heap_add_heap(struct sys_multi_heap *mheap, struct sys_heap *heap, void *user_data);
/Zephyr-latest/tests/lib/heap/src/
Dmain.c170 struct sys_heap heap; in ZTEST() local
175 sys_heap_init(&heap, heapmem, SMALL_HEAP_SZ); in ZTEST()
176 zassert_true(sys_heap_validate(&heap), ""); in ZTEST()
177 sys_heap_stress(testalloc, testfree, &heap, in ZTEST()
198 struct sys_heap heap; in ZTEST() local
204 sys_heap_init(&heap, heapmem, SMALL_HEAP_SZ); in ZTEST()
205 zassert_true(sys_heap_validate(&heap), ""); in ZTEST()
206 sys_heap_stress(testalloc, testfree, &heap, in ZTEST()
221 struct sys_heap heap; in ZTEST() local
231 sys_heap_init(&heap, heapmem, BIG_HEAP_SZ); in ZTEST()
[all …]
/Zephyr-latest/tests/lib/heap_align/src/
Dmain.c62 struct sys_heap heap = {}; in ZTEST() local
65 sys_heap_init(&heap, heapmem, HEAP_SZ); in ZTEST()
67 p = sys_heap_alloc(&heap, 1); in ZTEST()
69 sys_heap_free(&heap, p); in ZTEST()
80 check_heap_align(&heap, prefix, align, size); in ZTEST()
86 p = sys_heap_aligned_alloc(&heap, 8, 12); in ZTEST()
88 zassert_true(sys_heap_validate(&heap), "heap invalid"); in ZTEST()
89 sys_heap_free(&heap, p); in ZTEST()
92 p = sys_heap_aligned_alloc(&heap, 16, 16); in ZTEST()
93 q = sys_heap_aligned_alloc(&heap, 16, 17); in ZTEST()
[all …]
/Zephyr-latest/samples/basic/sys_heap/src/
Dmain.c13 static struct sys_heap heap; variable
23 sys_heap_init(&heap, heap_mem, HEAP_SIZE); in main()
26 p = sys_heap_alloc(&heap, 150); in main()
29 p = sys_heap_realloc(&heap, p, 100); in main()
32 sys_heap_free(&heap, p); in main()
41 sys_heap_runtime_stats_get(&heap, &stats); in print_sys_memory_stats()
/Zephyr-latest/samples/basic/sys_heap/
DREADME.rst1 .. zephyr:code-sample:: sys-heap
2 :name: System heap
4 Print system heap usage to the console.
10 prints system heap usage to the console.
36 System heap sample
38 allocated 0, free 196, max allocated 0, heap size 256
39 allocated 156, free 36, max allocated 156, heap size 256
40 allocated 100, free 92, max allocated 156, heap size 256
41 allocated 0, free 196, max allocated 156, heap size 256
/Zephyr-latest/lib/libc/newlib/
DKconfig15 int "Maximum memory mapped for newlib heap"
20 will be used for the newlib malloc() heap. The actual amount of
25 int "Newlib minimum required heap size"
30 newlib heap. An assertion failure message will be displayed during
31 initialization if the memory space available for the newlib heap is
35 int "Newlib aligned heap size"
42 and user mode threads need to access this heap, then this is necessary
43 to properly define an MPU region for the heap.
61 bool "Notify heap listeners of newlib libc heap events"
64 Notify registered heap listeners upon certain events related to the newlib
[all …]
/Zephyr-latest/doc/develop/languages/c/
Dcommon_libc.rst25 The common C library internally uses the :ref:`kernel memory heap API
26 <heap_v2>` to manage the memory heap used by the standard dynamic memory
29 The internal memory heap is normally located in the ``.bss`` section. When
32 threads. The size of the internal memory heap is specified by the
35 The default heap size for applications using the common C library is zero
36 (no heap). For other C library users, if there is an MMU present, then the
37 default heap is 16kB. Otherwise, the heap uses all available memory.
/Zephyr-latest/doc/kernel/memory_management/
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 …]
Dshared_multi_heap.rst6 The shared multi-heap memory pool manager uses the multi-heap allocator to
10 All the different regions can be added at run-time to the shared multi-heap
16 1. At boot time some platform code initialize the shared multi-heap framework
28 // Init the shared multi-heap pool
63 care of selecting the correct heap (thus memory region) to carve memory
65 (available memory, heap state, etc...)
/Zephyr-latest/drivers/bluetooth/hci/
DKconfig.esp326 prompt "Bluetooth adapter heap in use"
10 bool "Bluetooth adapter use ESP runtime heap"
14 bool "Bluetooth adapter use system heap"
/Zephyr-latest/samples/modules/tflite-micro/tflm_ethosu/src/
Dmain.cpp107 k_heap *heap = static_cast<k_heap *>(k_malloc(sizeof(k_heap))); in allocateHeap() local
110 if ((buf == nullptr) || (heap == nullptr)) { in allocateHeap()
111 printk("Heap allocation failed. heap=%p, buf=%p, size=%zu\n", heap, buf, size); in allocateHeap()
115 k_heap_init(heap, buf, size); in allocateHeap()
117 return static_cast<void *>(heap); in allocateHeap()
121 void inferenceProcessTask(void *_name, void *heap, void *_params) in inferenceProcessTask() argument
127 k_thread_heap_assign(k_current_get(), static_cast<k_heap *>(heap)); in inferenceProcessTask()
158 void inferenceSenderTask(void *_name, void *heap, void *_queue) in inferenceSenderTask() argument
165 k_thread_heap_assign(k_current_get(), static_cast<k_heap *>(heap)); in inferenceSenderTask()
/Zephyr-latest/modules/lz4/
DKconfig38 bool "in memory heap"
41 Allocate memory from heap (requires malloc()).
62 bool "in memory heap"
65 Allocate memory from heap (requires malloc()).
95 bool "in memory heap"
98 Allocate memory from heap (requires malloc()).
/Zephyr-latest/subsys/tracing/sysview/
Dtracing_sysview.h40 #define sys_port_trace_k_thread_heap_assign(thread, heap) argument
558 #define sys_port_trace_k_heap_init(heap) \ argument
559 SEGGER_SYSVIEW_RecordU32(TID_HEAP_INIT, (uint32_t)(uintptr_t)heap)
561 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout) \ argument
562 SEGGER_SYSVIEW_RecordU32x2(TID_HEAP_ALIGNED_ALLOC, (uint32_t)(uintptr_t)heap, \
565 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout) argument
567 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret) \ argument
570 #define sys_port_trace_k_heap_alloc_enter(heap, timeout) \ argument
571 SEGGER_SYSVIEW_RecordU32x2(TID_HEAP_ALLOC, (uint32_t)(uintptr_t)heap, \
574 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret) \ argument
[all …]
/Zephyr-latest/subsys/tracing/user/
Dtracing_user.h106 #define sys_port_trace_k_thread_heap_assign(thread, heap) argument
341 #define sys_port_trace_k_heap_init(heap) argument
342 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout) argument
343 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout) argument
344 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret) argument
345 #define sys_port_trace_k_heap_alloc_enter(heap, timeout) argument
346 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret) argument
347 #define sys_port_trace_k_heap_calloc_enter(heap, timeout) argument
348 #define sys_port_trace_k_heap_calloc_exit(heap, timeout, ret) argument
349 #define sys_port_trace_k_heap_free(heap) argument
[all …]
/Zephyr-latest/subsys/mgmt/mcumgr/grp/settings_mgmt/
DKconfig20 Selects if the stack or heap will be used for variables that are
37 Use dynamic heap memory allocation through malloc, if there is
38 insufficient heap memory for the allocation then the request will be
49 variable if placed on the heap.
57 variable if placed on the heap (settings does not support getting
/Zephyr-latest/drivers/i3c/
DKconfig.stm3226 int "Status FIFO and control FIFO heap"
30 Configures the heap size for dynamically allocating the regions for
33 during a single transfer. 2KB guarantees enough heap size for sending 256
/Zephyr-latest/subsys/mem_mgmt/
Dmem_attr_heap.c16 struct sys_heap heap; member
49 block = sys_heap_aligned_alloc(&h->heap, align, size); in mah_choice()
95 h = &mh->heap; in ma_heap_add()

123456