Lines Matching refs:bytes
263 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes) in sys_heap_alloc() argument
268 if ((bytes == 0U) || size_too_big(h, bytes)) { in sys_heap_alloc()
272 chunksz_t chunk_sz = bytes_to_chunksz(h, bytes); in sys_heap_alloc()
297 IF_ENABLED(CONFIG_MSAN, (__msan_allocated_memory(mem, bytes))); 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
319 return sys_heap_alloc(heap, bytes); in sys_heap_aligned_alloc()
326 if ((bytes == 0) || size_too_big(h, bytes)) { in sys_heap_aligned_alloc()
335 chunksz_t padded_sz = bytes_to_chunksz(h, bytes + align - gap); in sys_heap_aligned_alloc()
345 chunk_unit_t *end = (chunk_unit_t *) ROUND_UP(mem + bytes, CHUNK_UNIT); in sys_heap_aligned_alloc()
375 IF_ENABLED(CONFIG_MSAN, (__msan_allocated_memory(mem, bytes))); in sys_heap_aligned_alloc()
380 size_t align, size_t bytes) in sys_heap_aligned_realloc() argument
386 return sys_heap_aligned_alloc(heap, align, bytes); in sys_heap_aligned_realloc()
388 if (bytes == 0) { in sys_heap_aligned_realloc()
395 if (size_too_big(h, bytes)) { in sys_heap_aligned_realloc()
402 chunksz_t chunks_need = bytes_to_chunksz(h, bytes + align_gap); in sys_heap_aligned_realloc()
474 void *ptr2 = sys_heap_aligned_alloc(heap, align, bytes); in sys_heap_aligned_realloc()
479 memcpy(ptr2, ptr, MIN(prev_size, bytes)); in sys_heap_aligned_realloc()
485 void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes) in sys_heap_init() argument
487 IF_ENABLED(CONFIG_MSAN, (__sanitizer_dtor_callback(mem, bytes))); in sys_heap_init()
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()
499 bytes -= heap_footer_bytes(bytes); in sys_heap_init()
503 uintptr_t end = ROUND_DOWN((uint8_t *)mem + bytes, CHUNK_UNIT); in sys_heap_init()