the big memory changes. the most important changes are:

ei_aligned_malloc now really behaves like a malloc
 (untyped, doesn't call ctor)
ei_aligned_new is the typed variant calling ctor
EIGEN_MAKE_ALIGNED_OPERATOR_NEW now takes the class name as parameter
This commit is contained in:
Benoit Jacob
2009-01-08 15:20:21 +00:00
parent e2d2a7d222
commit 1d52bd4cad
21 changed files with 215 additions and 243 deletions

View File

@@ -25,28 +25,13 @@
// this hack is needed to make this file compiles with -pedantic (gcc)
#define throw(X)
// discard vectorization since the global operator new is not called in that case
#define EIGEN_DONT_VECTORIZE 1
// discard stack allocation as that too bypasses the global operator new
// discard stack allocation as that too bypasses malloc
#define EIGEN_STACK_ALLOCATION_LIMIT 0
// any heap allocation will raise an assert
#define EIGEN_NO_MALLOC
#include "main.h"
void* operator new[] (size_t n)
{
ei_assert(false && "operator new should never be called with fixed size path");
// the following is in case assertion are disabled
std::cerr << "operator new should never be called with fixed size path" << std::endl;
exit(2);
void* p = malloc(n);
return p;
}
void operator delete[](void* p) throw()
{
free(p);
}
template<typename MatrixType> void nomalloc(const MatrixType& m)
{
/* this test check no dynamic memory allocation are issued with fixed-size matrices