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

Function xmalloc_work

src/commonlib/bsd/include/commonlib/bsd/stdlib.h:23–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21int dma_coherent(const void *ptr);
22
23static inline void *xmalloc_work(size_t size, const char *file, const char *func, int line)
24{
25 void *ret = malloc(size);
26 if (!ret && size) {
27 printk(BIOS_ERR, "%s:%d %s(): Failed to malloc %zu bytes\n",
28 file, line, func, size);
29 abort();
30 }
31 return ret;
32}
33#define xmalloc(size) xmalloc_work((size), __FILE__, __func__, __LINE__)
34
35static inline void *xzalloc_work(size_t size, const char *file, const char *func, int line)

Callers 1

xzalloc_workFunction · 0.85

Calls 3

mallocFunction · 0.50
printkFunction · 0.50
abortFunction · 0.50

Tested by

no test coverage detected