Lines Matching refs:caps

30 static void *heap_caps_realloc_base( void *ptr, size_t size, uint32_t caps );
31 static void *heap_caps_calloc_base( size_t n, size_t size, uint32_t caps );
32 static void *heap_caps_malloc_base( size_t size, uint32_t caps );
53 HEAP_IRAM_ATTR static void fmt_abort_str(char dest[48], size_t size, uint32_t caps) in fmt_abort_str() argument
58 hex_to_str(sCaps, caps); in fmt_abort_str()
87 …E_ATTR static void heap_caps_alloc_failed(size_t requested_size, uint32_t caps, const char *functi… in heap_caps_alloc_failed() argument
90 alloc_failed_callback(requested_size, caps, function_name); in heap_caps_alloc_failed()
95 fmt_abort_str(buf, requested_size, caps); in heap_caps_alloc_failed()
111 bool heap_caps_match(const heap_t *heap, uint32_t caps) in heap_caps_match() argument
113 return heap->heap != NULL && ((get_all_caps(heap) & caps) == caps); in heap_caps_match()
121 HEAP_IRAM_ATTR static void *heap_caps_malloc_base( size_t size, uint32_t caps) in heap_caps_malloc_base() argument
131 if (caps & MALLOC_CAP_EXEC) { in heap_caps_malloc_base()
136 if ((caps & MALLOC_CAP_8BIT) || (caps & MALLOC_CAP_DMA)) { in heap_caps_malloc_base()
139 caps |= MALLOC_CAP_32BIT; // IRAM is 32-bit accessible RAM in heap_caps_malloc_base()
142 if (caps & MALLOC_CAP_32BIT) { in heap_caps_malloc_base()
156 if ((heap->caps[prio] & caps) != 0) { in heap_caps_malloc_base()
159 if ((get_all_caps(heap) & caps) == caps) { in heap_caps_malloc_base()
163 …if ((caps & MALLOC_CAP_EXEC) && !esp_dram_match_iram() && esp_ptr_in_diram_dram((void *)heap->star… in heap_caps_malloc_base()
171 CALL_HOOK(esp_heap_trace_alloc_hook, iptr, size, caps); in heap_caps_malloc_base()
178 CALL_HOOK(esp_heap_trace_alloc_hook, ret, size, caps); in heap_caps_malloc_base()
195 HEAP_IRAM_ATTR void *heap_caps_malloc( size_t size, uint32_t caps){ in heap_caps_malloc() argument
197 void* ptr = heap_caps_malloc_base(size, caps); in heap_caps_malloc()
201 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_malloc()
290 uint32_t caps = MALLOC_CAP_DEFAULT; in heap_caps_malloc_prefer() local
292 caps = va_arg( argp, uint32_t ); in heap_caps_malloc_prefer()
293 r = heap_caps_malloc_base( size, caps ); in heap_caps_malloc_prefer()
300 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_malloc_prefer()
314 uint32_t caps = MALLOC_CAP_DEFAULT; in heap_caps_realloc_prefer() local
316 caps = va_arg( argp, uint32_t ); in heap_caps_realloc_prefer()
317 r = heap_caps_realloc_base( ptr, size, caps ); in heap_caps_realloc_prefer()
324 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_realloc_prefer()
338 uint32_t caps = MALLOC_CAP_DEFAULT; in heap_caps_calloc_prefer() local
340 caps = va_arg( argp, uint32_t ); in heap_caps_calloc_prefer()
341 r = heap_caps_calloc_base( n, size, caps ); in heap_caps_calloc_prefer()
348 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_calloc_prefer()
397 HEAP_IRAM_ATTR static void *heap_caps_realloc_base( void *ptr, size_t size, uint32_t caps) in heap_caps_realloc_base() argument
404 return heap_caps_malloc_base(size, caps); in heap_caps_realloc_base()
437 bool compatible_caps = (caps & get_all_caps(heap)) == caps; in heap_caps_realloc_base()
444 CALL_HOOK(esp_heap_trace_alloc_hook, r, size, caps); in heap_caps_realloc_base()
451 void *new_p = heap_caps_malloc_base(size, caps); in heap_caps_realloc_base()
472 HEAP_IRAM_ATTR void *heap_caps_realloc( void *ptr, size_t size, uint32_t caps) in heap_caps_realloc() argument
474 ptr = heap_caps_realloc_base(ptr, size, caps); in heap_caps_realloc()
478 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_realloc()
488 HEAP_IRAM_ATTR static void *heap_caps_calloc_base( size_t n, size_t size, uint32_t caps) in heap_caps_calloc_base() argument
497 result = heap_caps_malloc_base(size_bytes, caps); in heap_caps_calloc_base()
504 HEAP_IRAM_ATTR void *heap_caps_calloc( size_t n, size_t size, uint32_t caps) in heap_caps_calloc() argument
506 void* ptr = heap_caps_calloc_base(n, size, caps); in heap_caps_calloc()
510 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_calloc()
516 size_t heap_caps_get_total_size(uint32_t caps) in heap_caps_get_total_size() argument
521 if (heap_caps_match(heap, caps)) { in heap_caps_get_total_size()
528 size_t heap_caps_get_free_size( uint32_t caps ) in heap_caps_get_free_size() argument
533 if (heap_caps_match(heap, caps)) { in heap_caps_get_free_size()
540 size_t heap_caps_get_minimum_free_size( uint32_t caps ) in heap_caps_get_minimum_free_size() argument
545 if (heap_caps_match(heap, caps)) { in heap_caps_get_minimum_free_size()
552 size_t heap_caps_get_largest_free_block( uint32_t caps ) in heap_caps_get_largest_free_block() argument
555 heap_caps_get_info(&info, caps); in heap_caps_get_largest_free_block()
559 void heap_caps_get_info( multi_heap_info_t *info, uint32_t caps ) in heap_caps_get_info() argument
565 if (heap_caps_match(heap, caps)) { in heap_caps_get_info()
581 void heap_caps_print_heap_info( uint32_t caps ) in heap_caps_print_heap_info() argument
584 printf("Heap summary for capabilities 0x%08"PRIX32":\n", caps); in heap_caps_print_heap_info()
587 if (heap_caps_match(heap, caps)) { in heap_caps_print_heap_info()
598 heap_caps_get_info(&info, caps); in heap_caps_print_heap_info()
603 bool heap_caps_check_integrity(uint32_t caps, bool print_errors) in heap_caps_check_integrity() argument
605 bool all_heaps = caps & MALLOC_CAP_INVALID; in heap_caps_check_integrity()
611 && (all_heaps || (get_all_caps(heap) & caps) == caps)) { in heap_caps_check_integrity()
633 void heap_caps_dump(uint32_t caps) in heap_caps_dump() argument
635 bool all_heaps = caps & MALLOC_CAP_INVALID; in heap_caps_dump()
639 && (all_heaps || (get_all_caps(heap) & caps) == caps)) { in heap_caps_dump()
658 HEAP_IRAM_ATTR void *heap_caps_aligned_alloc(size_t alignment, size_t size, uint32_t caps) in heap_caps_aligned_alloc() argument
678 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_aligned_alloc()
690 if ((heap->caps[prio] & caps) != 0) { in heap_caps_aligned_alloc()
693 if ((get_all_caps(heap) & caps) == caps) { in heap_caps_aligned_alloc()
697 CALL_HOOK(esp_heap_trace_alloc_hook, ret, size, caps); in heap_caps_aligned_alloc()
705 heap_caps_alloc_failed(size, caps, __func__); in heap_caps_aligned_alloc()
716 void *heap_caps_aligned_calloc(size_t alignment, size_t n, size_t size, uint32_t caps) in heap_caps_aligned_calloc() argument
723 void *ptr = heap_caps_aligned_alloc(alignment,size_bytes, caps); in heap_caps_aligned_calloc()