Lines Matching refs:mem

159 	uint8_t *mem = p, *base = (uint8_t *)chunk_buf(h);  in mem_to_chunkid()  local
160 return (mem - chunk_header_bytes(h) - base) / CHUNK_UNIT; in mem_to_chunkid()
163 void sys_heap_free(struct sys_heap *heap, void *mem) in sys_heap_free() argument
165 if (mem == NULL) { in sys_heap_free()
169 chunkid_t c = mem_to_chunkid(h, mem); in sys_heap_free()
176 "unexpected heap state (double-free?) for memory at %p", mem); in sys_heap_free()
185 mem); 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
203 chunkid_t c = mem_to_chunkid(h, mem); in sys_heap_usable_size()
204 size_t addr = (size_t)mem; in sys_heap_usable_size()
266 void *mem; in sys_heap_alloc() local
286 mem = chunk_mem(h, c); in sys_heap_alloc()
293 heap_listener_notify_alloc(HEAP_ID_FROM_POINTER(heap), mem, in sys_heap_alloc()
297 IF_ENABLED(CONFIG_MSAN, (__msan_allocated_memory(mem, bytes))); in sys_heap_alloc()
298 return mem; in sys_heap_alloc()
341 uint8_t *mem = chunk_mem(h, c0); in sys_heap_aligned_alloc() local
344 mem = (uint8_t *) ROUND_UP(mem + rew, align) - rew; in sys_heap_aligned_alloc()
345 chunk_unit_t *end = (chunk_unit_t *) ROUND_UP(mem + bytes, CHUNK_UNIT); in sys_heap_aligned_alloc()
348 chunkid_t c = mem_to_chunkid(h, mem); in sys_heap_aligned_alloc()
371 heap_listener_notify_alloc(HEAP_ID_FROM_POINTER(heap), mem, in sys_heap_aligned_alloc()
375 IF_ENABLED(CONFIG_MSAN, (__msan_allocated_memory(mem, bytes))); in sys_heap_aligned_alloc()
376 return mem; in sys_heap_aligned_alloc()
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()
502 uintptr_t addr = ROUND_UP(mem, CHUNK_UNIT); in sys_heap_init()
503 uintptr_t end = ROUND_DOWN((uint8_t *)mem + bytes, CHUNK_UNIT); in sys_heap_init()