MCPcopy Create free account
hub / github.com/coreboot/coreboot / alloc

Function alloc

payloads/libpayload/libc/malloc.c:210–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210static void *alloc(int len, struct memory_type *type)
211{
212 hdrtype_t volatile *ptr = find_free_block(len, type);
213
214 if (ptr == NULL)
215 return NULL;
216
217 use_block(ptr, len);
218 return (void *)((uintptr_t)ptr + HDRSIZE);
219}
220
221static void _consolidate(struct memory_type *type)
222{

Callers 5

mallocFunction · 0.85
dma_mallocFunction · 0.85
callocFunction · 0.85
reallocFunction · 0.85
allocate_regionFunction · 0.85

Calls 2

find_free_blockFunction · 0.85
use_blockFunction · 0.85

Tested by

no test coverage detected