diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 97ad9065f..37763c44d 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -313,10 +313,10 @@ struct WithAlignedOperatorNew * * Example: * \code -* // Vector4f requires 16 bytes alignment: -* std::vector > dataVec4; +* // Matrix4f requires 16 bytes alignment: +* std::map< int, Matrix4f, std::less, aligned_allocator > my_map_mat4; * // Vector3f does not require 16 bytes alignment, no need to use Eigen's allocator: -* std::vector dataVec3; +* std::map< int, Vector3f > my_map_vec3; * \endcode * */ @@ -392,51 +392,4 @@ public: } }; -/** \class ei_new_allocator -* -* \brief stl compatible allocator to use with with fixed-size vector and matrix types -* -* STL allocator simply wrapping operators new[] and delete[]. Unlike GCC's default new_allocator, -* ei_new_allocator call operator new on the type \a T and not the general new operator ignoring -* overloaded version of operator new. -* -* Example: -* \code -* // Vector4f requires 16 bytes alignment: -* std::vector > dataVec4; -* // Vector3f does not require 16 bytes alignment, no need to use Eigen's allocator: -* std::vector dataVec3; -* -* struct Foo : WithAlignedOperatorNew { -* char dummy; -* Vector4f some_vector; -* }; -* std::vector > dataFoo; -* \endcode -* -* \sa class WithAlignedOperatorNew -*/ -template class ei_new_allocator -{ -public: - typedef T value_type; - typedef T* pointer; - typedef const T* const_pointer; - typedef T& reference; - typedef const T& const_reference; - - template - struct rebind - { typedef ei_new_allocator other; }; - - T* address(T& ref) const { return &ref; } - const T* address(const T& ref) const { return &ref; } - T* allocate(size_t size, const void* = 0) { return new T[size]; } - void deallocate(T* ptr, size_t) { delete[] ptr; } - size_t max_size() const { return size_t(-1) / sizeof(T); } - // FIXME I'm note sure about this construction... - void construct(T* ptr, const T& refObj) { ::new(ptr) T(refObj); } - void destroy(T* ptr) { ptr->~T(); } -}; - #endif // EIGEN_MEMORY_H diff --git a/test/dynalloc.cpp b/test/dynalloc.cpp index ffe21771a..899342d83 100644 --- a/test/dynalloc.cpp +++ b/test/dynalloc.cpp @@ -137,20 +137,5 @@ void test_dynalloc() delete[] foo0; delete[] fooA; } - - // std::vector - for (int i=0; i > vecs(N); - for (int j=0; j > foos(N); - for (int j=0; j