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.

34 lines
637 B

  1. #ifndef EIGEN_QTMALLOC_MODULE_H
  2. #define EIGEN_QTMALLOC_MODULE_H
  3. #include "Core"
  4. #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
  5. #include "src/Core/util/DisableStupidWarnings.h"
  6. void *qMalloc(size_t size)
  7. {
  8. return Eigen::internal::aligned_malloc(size);
  9. }
  10. void qFree(void *ptr)
  11. {
  12. Eigen::internal::aligned_free(ptr);
  13. }
  14. void *qRealloc(void *ptr, size_t size)
  15. {
  16. void* newPtr = Eigen::internal::aligned_malloc(size);
  17. memcpy(newPtr, ptr, size);
  18. Eigen::internal::aligned_free(ptr);
  19. return newPtr;
  20. }
  21. #include "src/Core/util/ReenableStupidWarnings.h"
  22. #endif
  23. #endif // EIGEN_QTMALLOC_MODULE_H
  24. /* vim: set filetype=cpp et sw=2 ts=2 ai: */