You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
930 B

  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. #ifndef EIGEN_QTMALLOC_MODULE_H
  8. #define EIGEN_QTMALLOC_MODULE_H
  9. #include "Core"
  10. #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
  11. #include "src/Core/util/DisableStupidWarnings.h"
  12. void *qMalloc(size_t size)
  13. {
  14. return Eigen::internal::aligned_malloc(size);
  15. }
  16. void qFree(void *ptr)
  17. {
  18. Eigen::internal::aligned_free(ptr);
  19. }
  20. void *qRealloc(void *ptr, size_t size)
  21. {
  22. void* newPtr = Eigen::internal::aligned_malloc(size);
  23. memcpy(newPtr, ptr, size);
  24. Eigen::internal::aligned_free(ptr);
  25. return newPtr;
  26. }
  27. #include "src/Core/util/ReenableStupidWarnings.h"
  28. #endif
  29. #endif // EIGEN_QTMALLOC_MODULE_H
  30. /* vim: set filetype=cpp et sw=2 ts=2 ai: */