2015-10-26 11:46:05 +01:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
// for linear algebra.
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2009-01-20 16:50:47 +00:00
|
|
|
|
|
|
|
#ifndef EIGEN_QTMALLOC_MODULE_H
|
|
|
|
#define EIGEN_QTMALLOC_MODULE_H
|
|
|
|
|
|
|
|
#include "Core"
|
|
|
|
|
|
|
|
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
|
|
|
|
2011-02-22 09:31:22 -05:00
|
|
|
#include "src/Core/util/DisableStupidWarnings.h"
|
2009-09-02 21:23:09 +02:00
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
void *qMalloc(std::size_t size) { return Eigen::internal::aligned_malloc(size); }
|
2009-01-20 16:50:47 +00:00
|
|
|
|
2010-10-25 10:15:22 -04:00
|
|
|
void qFree(void *ptr) { Eigen::internal::aligned_free(ptr); }
|
2009-01-20 16:50:47 +00:00
|
|
|
|
2017-01-23 22:02:53 +01:00
|
|
|
void *qRealloc(void *ptr, std::size_t size) {
|
2010-10-25 10:15:22 -04:00
|
|
|
void *newPtr = Eigen::internal::aligned_malloc(size);
|
2017-09-22 09:23:24 +02:00
|
|
|
std::memcpy(newPtr, ptr, size);
|
2010-10-25 10:15:22 -04:00
|
|
|
Eigen::internal::aligned_free(ptr);
|
2009-01-20 16:50:47 +00:00
|
|
|
return newPtr;
|
|
|
|
}
|
|
|
|
|
2011-02-22 09:31:22 -05:00
|
|
|
#include "src/Core/util/ReenableStupidWarnings.h"
|
2009-09-02 21:23:09 +02:00
|
|
|
|
2009-01-20 16:50:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // EIGEN_QTMALLOC_MODULE_H
|