mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-03 06:50:57 +08:00
30 lines
483 B
Plaintext
30 lines
483 B
Plaintext
|
|
#ifndef EIGEN_QTMALLOC_MODULE_H
|
|
#define EIGEN_QTMALLOC_MODULE_H
|
|
|
|
#include "Core"
|
|
|
|
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
|
|
|
void *qMalloc(size_t size)
|
|
{std::cerr << "ok\n";
|
|
return Eigen::ei_aligned_malloc(size);
|
|
}
|
|
|
|
void qFree(void *ptr)
|
|
{
|
|
Eigen::ei_aligned_free(ptr);
|
|
}
|
|
|
|
void *qRealloc(void *ptr, size_t size)
|
|
{
|
|
void* newPtr = Eigen::ei_aligned_malloc(size);
|
|
memcpy(newPtr, ptr, size);
|
|
Eigen::ei_aligned_free(ptr);
|
|
return newPtr;
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif // EIGEN_QTMALLOC_MODULE_H
|