2009-01-21 00:50:47 +08:00
|
|
|
|
|
|
|
#ifndef EIGEN_QTMALLOC_MODULE_H
|
|
|
|
#define EIGEN_QTMALLOC_MODULE_H
|
|
|
|
|
|
|
|
#include "Core"
|
|
|
|
|
|
|
|
#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
|
|
|
|
2009-09-03 03:23:09 +08:00
|
|
|
#include "src/Core/util/DisableMSVCWarnings.h"
|
|
|
|
|
2009-05-19 00:09:21 +08:00
|
|
|
void *qMalloc(size_t size)
|
2009-09-03 03:23:09 +08:00
|
|
|
{
|
2010-10-25 22:15:22 +08:00
|
|
|
return Eigen::internal::aligned_malloc(size);
|
2009-01-21 00:50:47 +08:00
|
|
|
}
|
|
|
|
|
2009-05-19 00:09:21 +08:00
|
|
|
void qFree(void *ptr)
|
2009-01-21 00:50:47 +08:00
|
|
|
{
|
2010-10-25 22:15:22 +08:00
|
|
|
Eigen::internal::aligned_free(ptr);
|
2009-01-21 00:50:47 +08:00
|
|
|
}
|
|
|
|
|
2009-05-19 00:09:21 +08:00
|
|
|
void *qRealloc(void *ptr, size_t size)
|
2009-01-21 00:50:47 +08:00
|
|
|
{
|
2010-10-25 22:15:22 +08:00
|
|
|
void* newPtr = Eigen::internal::aligned_malloc(size);
|
2009-01-21 00:50:47 +08:00
|
|
|
memcpy(newPtr, ptr, size);
|
2010-10-25 22:15:22 +08:00
|
|
|
Eigen::internal::aligned_free(ptr);
|
2009-01-21 00:50:47 +08:00
|
|
|
return newPtr;
|
|
|
|
}
|
|
|
|
|
2009-09-03 03:23:09 +08:00
|
|
|
#include "src/Core/util/EnableMSVCWarnings.h"
|
|
|
|
|
2009-01-21 00:50:47 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // EIGEN_QTMALLOC_MODULE_H
|
2009-12-02 07:00:29 +08:00
|
|
|
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|