2009-01-21 00:50:47 +08:00
|
|
|
|
|
|
|
#ifndef EIGEN_QTMALLOC_MODULE_H
|
|
|
|
#define EIGEN_QTMALLOC_MODULE_H
|
|
|
|
|
|
|
|
#include "Core"
|
|
|
|
|
|
|
|
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
|
|
|
|
2009-01-26 21:59:52 +08:00
|
|
|
inline void *qMalloc(size_t size)
|
2009-01-21 00:50:47 +08:00
|
|
|
{
|
|
|
|
return Eigen::ei_aligned_malloc(size);
|
|
|
|
}
|
|
|
|
|
2009-01-26 21:59:52 +08:00
|
|
|
inline void qFree(void *ptr)
|
2009-01-21 00:50:47 +08:00
|
|
|
{
|
|
|
|
Eigen::ei_aligned_free(ptr);
|
|
|
|
}
|
|
|
|
|
2009-01-26 21:59:52 +08:00
|
|
|
inline void *qRealloc(void *ptr, size_t size)
|
2009-01-21 00:50:47 +08:00
|
|
|
{
|
|
|
|
void* newPtr = Eigen::ei_aligned_malloc(size);
|
|
|
|
memcpy(newPtr, ptr, size);
|
|
|
|
Eigen::ei_aligned_free(ptr);
|
|
|
|
return newPtr;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // EIGEN_QTMALLOC_MODULE_H
|