1 // This file is part of Eigen, a lightweight C++ template library
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/.
8 #ifndef EIGEN_QTMALLOC_MODULE_H
9 #define EIGEN_QTMALLOC_MODULE_H
13 #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
15 #include "src/Core/util/DisableStupidWarnings.h"
17 void *qMalloc(std::size_t size)
19 return Eigen::internal::aligned_malloc(size);
24 Eigen::internal::aligned_free(ptr);
27 void *qRealloc(void *ptr, std::size_t size)
29 void* newPtr = Eigen::internal::aligned_malloc(size);
30 memcpy(newPtr, ptr, size);
31 Eigen::internal::aligned_free(ptr);
35 #include "src/Core/util/ReenableStupidWarnings.h"
39 #endif // EIGEN_QTMALLOC_MODULE_H
40 /* vim: set filetype=cpp et sw=2 ts=2 ai: */