Incorrect use of aligned_alloc in memory allocator
See memory.cc:
uint64_t MallocAllocator::alloc(uint64_t len, uint16_t align)
{
auto p = aligned_alloc(align, len);
return reinterpret_cast<uint64_t>(p);
}
aligned_alloc
requires that len
is an integer multiple of align
, otherwise since C++17 the function errors and NULL
is returned. In older standards the behavior is undefined.