mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-23 05:14:26 +08:00
Code cleanup.
This commit is contained in:
parent
76d578fb99
commit
fc8b54c142
@ -1,6 +1,8 @@
|
||||
#ifndef EIGEN_QTMALLOC_MODULE_H
|
||||
#define EIGEN_QTMALLOC_MODULE_H
|
||||
|
||||
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
||||
|
||||
#ifdef QVECTOR_H
|
||||
#error You must include <Eigen/QtAlignedMalloc> before <QtCore/QVector>.
|
||||
#endif
|
||||
@ -16,9 +18,6 @@
|
||||
#include "Core"
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QVectorData>
|
||||
|
||||
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
||||
|
||||
inline void *qMalloc(size_t size)
|
||||
{
|
||||
@ -38,16 +37,6 @@ inline void *qRealloc(void *ptr, size_t size)
|
||||
return newPtr;
|
||||
}
|
||||
|
||||
// needed to copy that too because it is implemented in the qt binary library, hence
|
||||
// wouldn't otherwise honor our qMalloc.
|
||||
QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init)
|
||||
{
|
||||
QVectorData* p = (QVectorData *)qMalloc(sizeofTypedData + (size - 1) * sizeofT);
|
||||
Q_CHECK_PTR(p);
|
||||
::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT);
|
||||
return p;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef Q_DECL_IMPORT_ORIG
|
||||
|
Loading…
x
Reference in New Issue
Block a user