aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/QtAlignedMalloc
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-01-20 16:50:47 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-01-20 16:50:47 +0000
commitf645d1f911fe31ed9a1203681956fd87bc49fcf3 (patch)
treeb28c5d95d9a372b3f16637d7f916ca81a888f102 /Eigen/QtAlignedMalloc
parent8973d12cdae503e0996edd52f8c78879274c0e70 (diff)
* complete the support of QVector via a QtAlignedMalloc header
* add a unit test for QVector which shows the issue with QVector::fill
Diffstat (limited to 'Eigen/QtAlignedMalloc')
-rw-r--r--Eigen/QtAlignedMalloc29
1 files changed, 29 insertions, 0 deletions
diff --git a/Eigen/QtAlignedMalloc b/Eigen/QtAlignedMalloc
new file mode 100644
index 000000000..38a108381
--- /dev/null
+++ b/Eigen/QtAlignedMalloc
@@ -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