eigen/Eigen/QtAlignedMalloc
Gael Guennebaud f645d1f911 * complete the support of QVector via a QtAlignedMalloc header
* add a unit test for QVector which shows the issue with QVector::fill
2009-01-20 16:50:47 +00:00

30 lines
463 B
Plaintext

#ifndef EIGEN_QTMALLOC_MODULE_H
#define EIGEN_QTMALLOC_MODULE_H
#include "Core"
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
void *qMalloc(size_t size)
{
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