mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-27 23:32:02 +08:00
tentative fix for bug #61
This commit is contained in:
parent
a4a3e511d0
commit
9af431e78e
@ -3,6 +3,7 @@
|
|||||||
#define EIGEN_QTMALLOC_MODULE_H
|
#define EIGEN_QTMALLOC_MODULE_H
|
||||||
|
|
||||||
#include "Core"
|
#include "Core"
|
||||||
|
#include <QtCore/QVectorData>
|
||||||
|
|
||||||
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
||||||
|
|
||||||
@ -24,6 +25,16 @@ inline void *qRealloc(void *ptr, size_t size)
|
|||||||
return newPtr;
|
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
|
#endif
|
||||||
|
|
||||||
#endif // EIGEN_QTMALLOC_MODULE_H
|
#endif // EIGEN_QTMALLOC_MODULE_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user