| /Zephyr-latest/kernel/ | 
| D | kheap.c | 15 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 	heap->lock = (struct k_spinlock) {};  in k_heap_init() 19 	sys_heap_init(&heap->heap, mem, bytes);  in k_heap_init() 21 	SYS_PORT_TRACING_OBJ_INIT(k_heap, heap);  in k_heap_init() 26 	STRUCT_SECTION_FOREACH(k_heap, heap) {  in statics_init() 41 		if (lnkr_is_pinned((uint8_t *)heap) &&  in statics_init() 42 		    lnkr_is_pinned((uint8_t *)&heap->wait_q) &&  in statics_init() 43 		    lnkr_is_region_pinned((uint8_t *)heap->heap.init_mem,  in statics_init() 44 					  heap->heap.init_bytes)) {  in statics_init() [all …] 
 | 
| D | mempool.c | 12 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/ | 
| D | heap_stats.c | 11 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()
  | 
| D | multi_heap.c | 10 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 …] 
 | 
| D | heap_array.c | 12 int sys_heap_array_save(struct sys_heap *heap)  in sys_heap_array_save()  argument 14 	if (heap == NULL) {  in sys_heap_array_save() 19 		heaps[i++] = heap;  in sys_heap_array_save() 27 int sys_heap_array_get(struct sys_heap ***heap)  in sys_heap_array_get()  argument 29 	if (heap == NULL) {  in sys_heap_array_get() 33 	*heap = heaps;  in sys_heap_array_get()
  | 
| D | Kconfig | 8 	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 …] 
 | 
| D | heap.c | 163 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 …] 
 | 
| D | heap_info.c | 73 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/ | 
| D | sys_heap.h | 58 	struct z_heap *heap;  member 83 int sys_heap_runtime_stats_get(struct sys_heap *heap, 95 int sys_heap_runtime_stats_reset_max(struct sys_heap *heap); 105 void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes); 124 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes); 139 void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes); 154 void sys_heap_free(struct sys_heap *heap, void *mem); 174 void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr, 177 #define sys_heap_realloc(heap, ptr, bytes) \  argument 178 	sys_heap_aligned_realloc(heap, ptr, 0, bytes) [all …] 
 | 
| D | multi_heap.h | 62 	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/ | 
| D | main.c | 170 	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/samples/basic/sys_heap/src/ | 
| D | main.c | 15 static struct sys_heap heap;  variable 26 	sys_heap_init(&heap, heap_mem, HEAP_SIZE);  in main() 27 	print_sys_memory_stats(&heap);  in main() 29 	p = sys_heap_alloc(&heap, 150);  in main() 30 	print_sys_memory_stats(&heap);  in main() 32 	p = sys_heap_realloc(&heap, p, 100);  in main() 33 	print_sys_memory_stats(&heap);  in main() 35 	sys_heap_free(&heap, p);  in main() 36 	print_sys_memory_stats(&heap);  in main()
  | 
| /Zephyr-latest/tests/lib/heap_align/src/ | 
| D | main.c | 91 	struct sys_heap heap = {};  in ZTEST()  local 94 	sys_heap_init(&heap, heapmem, HEAP_SZ);  in ZTEST() 96 	p = sys_heap_alloc(&heap, 1);  in ZTEST() 98 	sys_heap_free(&heap, p);  in ZTEST() 104 	heap_end = heapmem + heap.heap->end_chunk * CHUNK_UNIT;  in ZTEST() 105 	heap_chunk_header_size = chunk_header_bytes(heap.heap);  in ZTEST() 110 				check_heap_align(&heap, prefix, align, size);  in ZTEST() 112 					check_heap_align(&heap, prefix,  in ZTEST() 120 	p = sys_heap_aligned_alloc(&heap, 8, 12);  in ZTEST() 122 	zassert_true(sys_heap_validate(&heap), "heap invalid");  in ZTEST() [all …] 
 | 
| /Zephyr-latest/samples/basic/sys_heap/ | 
| D | README.rst | 1 .. 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/ | 
| D | Kconfig | 15 	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/ | 
| D | common_libc.rst | 25 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/ | 
| D | heap.rst | 15 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 …] 
 | 
| D | shared_multi_heap.rst | 6 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/samples/modules/tflite-micro/tflm_ethosu/src/ | 
| D | main.cpp | 107 	k_heap *heap = static_cast<k_heap *>(k_malloc(sizeof(k_heap)));  in allocateHeap()  local 110 	if ((buf == nullptr) || (heap == nullptr)) {  in allocateHeap() 111 		printf("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/drivers/bluetooth/hci/ | 
| D | Kconfig.esp32 | 10 	  Make sure there is a minimal heap available for BT driver. 13 	prompt "Bluetooth adapter heap in use" 17 		bool "Bluetooth adapter use the kernel mempool heap (k_malloc)"
  | 
| /Zephyr-latest/modules/lz4/ | 
| D | Kconfig | 38 	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/user/ | 
| D | tracing_user.h | 107 #define sys_port_trace_k_thread_heap_assign(thread, heap)  argument 353 #define sys_port_trace_k_heap_init(heap)  argument 354 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout)  argument 355 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout)  argument 356 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret)  argument 357 #define sys_port_trace_k_heap_alloc_enter(heap, timeout)  argument 358 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret)  argument 359 #define sys_port_trace_k_heap_calloc_enter(heap, timeout)  argument 360 #define sys_port_trace_k_heap_calloc_exit(heap, timeout, ret)  argument 361 #define sys_port_trace_k_heap_free(heap)  argument [all …] 
 | 
| /Zephyr-latest/subsys/mgmt/mcumgr/grp/settings_mgmt/ | 
| D | Kconfig | 20 	  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/ | 
| D | Kconfig.stm32 | 26 	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/tracing/sysview/ | 
| D | tracing_sysview.h | 40 #define sys_port_trace_k_thread_heap_assign(thread, heap)  argument 569 #define sys_port_trace_k_heap_init(heap)                                                           \  argument 570 	SEGGER_SYSVIEW_RecordU32(TID_HEAP_INIT, (uint32_t)(uintptr_t)heap) 572 #define sys_port_trace_k_heap_aligned_alloc_enter(heap, timeout)                                   \  argument 573 	SEGGER_SYSVIEW_RecordU32x2(TID_HEAP_ALIGNED_ALLOC, (uint32_t)(uintptr_t)heap,              \ 576 #define sys_port_trace_k_heap_aligned_alloc_blocking(heap, timeout)  argument 578 #define sys_port_trace_k_heap_aligned_alloc_exit(heap, timeout, ret)                               \  argument 581 #define sys_port_trace_k_heap_alloc_enter(heap, timeout)                                           \  argument 582 	SEGGER_SYSVIEW_RecordU32x2(TID_HEAP_ALLOC, (uint32_t)(uintptr_t)heap,                      \ 585 #define sys_port_trace_k_heap_alloc_exit(heap, timeout, ret)                                       \  argument [all …] 
 |