memalign is deprecated and linux-only, and malloc.h does not exist on
non-glibc systems.
Change-Id: I44942378b7514c2a3fb6cb5f60256bbcc8ffe370
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
#include <QLinkedList>
#include <iostream>
-#include <malloc.h>
+#include <cstdlib>
using namespace QQmlJS::VM;
return alloc(size - sizeof(MMInfo));
std::size_t allocSize = std::max(size, CHUNK_SIZE);
- char *ptr = (char*)memalign(16, allocSize);
+ char *ptr = 0;
+ posix_memalign(reinterpret_cast<void**>(&ptr), 16, allocSize);
m_d->heapChunks.append(qMakePair(ptr, allocSize));
// qDebug("Allocated new chunk of %lu bytes @ %p", allocSize, ptr);