Rev | Line | |
---|
[136] | 1 |
|
---|
| 2 | #ifndef EIGEN_QTMALLOC_MODULE_H
|
---|
| 3 | #define EIGEN_QTMALLOC_MODULE_H
|
---|
| 4 |
|
---|
| 5 | #include "Core"
|
---|
| 6 |
|
---|
| 7 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
|
---|
| 8 |
|
---|
| 9 | #include "src/Core/util/DisableStupidWarnings.h"
|
---|
| 10 |
|
---|
| 11 | void *qMalloc(size_t size)
|
---|
| 12 | {
|
---|
| 13 | return Eigen::internal::aligned_malloc(size);
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | void qFree(void *ptr)
|
---|
| 17 | {
|
---|
| 18 | Eigen::internal::aligned_free(ptr);
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | void *qRealloc(void *ptr, size_t size)
|
---|
| 22 | {
|
---|
| 23 | void* newPtr = Eigen::internal::aligned_malloc(size);
|
---|
| 24 | memcpy(newPtr, ptr, size);
|
---|
| 25 | Eigen::internal::aligned_free(ptr);
|
---|
| 26 | return newPtr;
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | #include "src/Core/util/ReenableStupidWarnings.h"
|
---|
| 30 |
|
---|
| 31 | #endif
|
---|
| 32 |
|
---|
| 33 | #endif // EIGEN_QTMALLOC_MODULE_H
|
---|
| 34 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.