aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/QtAlignedMalloc
blob: de4da752cef357ec0fae4e45158f032320dbdc22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

#ifndef EIGEN_QTMALLOC_MODULE_H
#define EIGEN_QTMALLOC_MODULE_H

#include "Core"

#if (!EIGEN_MALLOC_ALREADY_ALIGNED)

void *qMalloc(size_t size)
{std::cerr << "ok\n";
  return Eigen::ei_aligned_malloc(size);
}

void qFree(void *ptr)
{
  Eigen::ei_aligned_free(ptr);
}

void *qRealloc(void *ptr, size_t size)
{
  void* newPtr = Eigen::ei_aligned_malloc(size);
  memcpy(newPtr, ptr, size);
  Eigen::ei_aligned_free(ptr);
  return newPtr;
}

#endif

#endif // EIGEN_QTMALLOC_MODULE_H