* complete the support of QVector via a QtAlignedMalloc header

* add a unit test for QVector which shows the issue with QVector::fill
This commit is contained in:
Gael Guennebaud
2009-01-20 16:50:47 +00:00
parent 8973d12cda
commit f645d1f911
7 changed files with 265 additions and 42 deletions

29
Eigen/QtAlignedMalloc Normal file
View File

@@ -0,0 +1,29 @@
#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