Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/eigen3/Eigen/QtAlignedMalloc is written in an unsupported language. File is not indexed.

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // This Source Code Form is subject to the terms of the Mozilla
0005 // Public License v. 2.0. If a copy of the MPL was not distributed
0006 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0007 
0008 #ifndef EIGEN_QTMALLOC_MODULE_H
0009 #define EIGEN_QTMALLOC_MODULE_H
0010 
0011 #include "Core"
0012 
0013 #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
0014 
0015 #include "src/Core/util/DisableStupidWarnings.h"
0016 
0017 void *qMalloc(std::size_t size)
0018 {
0019   return Eigen::internal::aligned_malloc(size);
0020 }
0021 
0022 void qFree(void *ptr)
0023 {
0024   Eigen::internal::aligned_free(ptr);
0025 }
0026 
0027 void *qRealloc(void *ptr, std::size_t size)
0028 {
0029   void* newPtr = Eigen::internal::aligned_malloc(size);
0030   std::memcpy(newPtr, ptr, size);
0031   Eigen::internal::aligned_free(ptr);
0032   return newPtr;
0033 }
0034 
0035 #include "src/Core/util/ReenableStupidWarnings.h"
0036 
0037 #endif
0038 
0039 #endif // EIGEN_QTMALLOC_MODULE_H