Lines Matching full:heap
11 #include "heap.h"
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()
176 "unexpected heap state (double-free?) for memory at %p", mem); in sys_heap_free()
184 "corrupted heap bounds (buffer overflow?) for memory at %p", 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()
319 return sys_heap_alloc(heap, bytes); in sys_heap_aligned_alloc()
371 heap_listener_notify_alloc(HEAP_ID_FROM_POINTER(heap), mem, in sys_heap_aligned_alloc()
379 void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr, in sys_heap_aligned_realloc() argument
382 struct z_heap *h = heap->heap; in sys_heap_aligned_realloc()
386 return sys_heap_aligned_alloc(heap, align, bytes); in sys_heap_aligned_realloc()
389 sys_heap_free(heap, ptr); in sys_heap_aligned_realloc()
425 heap_listener_notify_alloc(HEAP_ID_FROM_POINTER(heap), ptr, in sys_heap_aligned_realloc()
427 heap_listener_notify_free(HEAP_ID_FROM_POINTER(heap), ptr, in sys_heap_aligned_realloc()
456 heap_listener_notify_alloc(HEAP_ID_FROM_POINTER(heap), ptr, in sys_heap_aligned_realloc()
458 heap_listener_notify_free(HEAP_ID_FROM_POINTER(heap), ptr, in sys_heap_aligned_realloc()
470 * Note for heap listener notification: in sys_heap_aligned_realloc()
474 void *ptr2 = sys_heap_aligned_alloc(heap, align, bytes); in sys_heap_aligned_realloc()
480 sys_heap_free(heap, ptr); in sys_heap_aligned_realloc()
485 void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes) in sys_heap_init() argument
491 __ASSERT(bytes / CHUNK_UNIT <= 0x7fffU, "heap size is too big"); in sys_heap_init()
494 __ASSERT(bytes / CHUNK_UNIT <= 0x7fffffffU, "heap size is too big"); in sys_heap_init()
498 __ASSERT(bytes > heap_footer_bytes(bytes), "heap size is too small"); in sys_heap_init()
507 __ASSERT(heap_sz > chunksz(sizeof(struct z_heap)), "heap size is too small"); in sys_heap_init()
510 heap->heap = h; in sys_heap_init()
524 __ASSERT(chunk0_size + min_chunk_size(h) <= heap_sz, "heap size is too small"); in sys_heap_init()
535 /* chunk containing the free heap */ in sys_heap_init()