Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
QtAlignedMalloc
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// This Source Code Form is subject to the terms of the Mozilla
5// Public License v. 2.0. If a copy of the MPL was not distributed
6// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8#ifndef EIGEN_QTMALLOC_MODULE_H
9#define EIGEN_QTMALLOC_MODULE_H
10
11#include "Core"
12
13#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
14
15#include "src/Core/util/DisableStupidWarnings.h"
16
17void *qMalloc(std::size_t size) { return Eigen::internal::aligned_malloc(size); }
18
19void qFree(void *ptr) { Eigen::internal::aligned_free(ptr); }
20
21void *qRealloc(void *ptr, std::size_t size) {
22 void *newPtr = Eigen::internal::aligned_malloc(size);
23 std::memcpy(newPtr, ptr, size);
24 Eigen::internal::aligned_free(ptr);
25 return newPtr;
26}
27
28#include "src/Core/util/ReenableStupidWarnings.h"
29
30#endif
31
32#endif // EIGEN_QTMALLOC_MODULE_H