Lines Matching full:heap
26 region->heap = multi_heap_register((void *)region->start, heap_size); in register_heap()
27 if (region->heap != NULL) { in register_heap()
28 ESP_EARLY_LOGD(TAG, "New heap initialised at %p", region->heap); in register_heap()
34 heap_t *heap; in heap_caps_enable_nonos_stack_heaps() local
35 SLIST_FOREACH(heap, ®istered_heaps, next) { in heap_caps_enable_nonos_stack_heaps()
36 // Assume any not-yet-registered heap is in heap_caps_enable_nonos_stack_heaps()
37 // a nonos-stack heap in heap_caps_enable_nonos_stack_heaps()
38 if (heap->heap == NULL) { in heap_caps_enable_nonos_stack_heaps()
39 register_heap(heap); in heap_caps_enable_nonos_stack_heaps()
40 if (heap->heap != NULL) { in heap_caps_enable_nonos_stack_heaps()
41 multi_heap_set_lock(heap->heap, &heap->heap_mux); in heap_caps_enable_nonos_stack_heaps()
47 /* Initialize the heap allocator to use all of the memory not
67 …//The heap allocator will treat every region given to it as separate. In order to get bigger range… in heap_caps_init()
77 // remove one heap from the number of heaps as in heap_caps_init()
83 /* Start by allocating the registered heap data on the stack. in heap_caps_init()
85 Once we have a heap to copy it to, we will copy it to a heap buffer. in heap_caps_init()
94 heap_t *heap = &temp_heaps[heap_idx]; in heap_caps_init() local
101 memcpy(heap->caps, type->caps, sizeof(heap->caps)); in heap_caps_init()
102 heap->start = region->start; in heap_caps_init()
103 heap->end = region->start + region->size; in heap_caps_init()
104 MULTI_HEAP_LOCK_INIT(&heap->heap_mux); in heap_caps_init()
107 heap->heap = NULL; in heap_caps_init()
109 register_heap(heap); in heap_caps_init()
111 SLIST_NEXT(heap, next) = NULL; in heap_caps_init()
119 /* Allocate the permanent heap data that we'll use as a linked list at runtime. in heap_caps_init()
127 /* use the first DRAM heap which can fit the data */ in heap_caps_init()
128 heaps_array = multi_heap_malloc(temp_heaps[i].heap, sizeof(heap_t) * num_heaps); in heap_caps_init()
134 assert(heaps_array != NULL); /* if NULL, there's not enough free startup heap space */ in heap_caps_init()
140 if (heaps_array[i].heap != NULL) { in heap_caps_init()
141 multi_heap_set_lock(heaps_array[i].heap, &heaps_array[i].heap_mux); in heap_caps_init()
174 * Specially, the 3rd scenario can be allowed. For example, allocate memory from heap, in heap_caps_check_add_region_allowed()
178 * cannot be added twice. In fact, registering the same memory region as a heap twice in heap_caps_check_add_region_allowed()
181 * the existing heap region s(tart) e(nd) in heap_caps_check_add_region_allowed()
216 heap_t *heap; in heap_caps_add_region_with_caps() local
217 SLIST_FOREACH(heap, ®istered_heaps, next) { in heap_caps_add_region_with_caps()
218 if (!heap_caps_check_add_region_allowed(heap->start, heap->end, start, end)) { in heap_caps_add_region_with_caps()
219 ESP_EARLY_LOGD(TAG, "invalid overlap detected with existing heap region"); in heap_caps_add_region_with_caps()
233 p_new->heap = multi_heap_register((void *)start, end - start); in heap_caps_add_region_with_caps()
235 if (p_new->heap == NULL) { in heap_caps_add_region_with_caps()
239 multi_heap_set_lock(p_new->heap, &p_new->heap_mux); in heap_caps_add_region_with_caps()