MCPcopy Create free account
hub / github.com/adny-code/fastgrind / je_aligned_alloc_emulate

Function je_aligned_alloc_emulate

include/fastgrind.h:1582–1596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1580 }
1581
1582 MEM_NO_INSTRUMENT MEM_INLINE_USED static inline void *je_aligned_alloc_emulate(size_t alignment, size_t size)
1583 {
1584 if (alignment == 0 || (alignment & (alignment - 1)) != 0 || (alignment % sizeof(void *) != 0))
1585 {
1586 errno = EINVAL;
1587 return nullptr;
1588 }
1589 if (size % alignment != 0)
1590 {
1591 errno = EINVAL;
1592 return nullptr;
1593 }
1594
1595 return mallocx(size, MALLOCX_ALIGN(alignment));
1596 }
1597
1598#else
1599 #define DEFAULT_MALLOC 1

Callers 1

__wrap_aligned_allocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected