[eigen] Re: Custom new[]/delete[]

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I see that *_auto allocators are used for dense matrices (DenseStorage.h):

conditional_aligned_new_auto
conditional_aligned_realloc_new_auto
conditional_aligned_delete_auto

align_new, align_delete are used in GeneralMatrixMatrix.h

Looks like only these functions should be overloaded. 

Please confirm.

Thank you in advance,
Pavel.

P.S.
SparseMatrix uses pure overloadable new[]/delete[] - no questions there.


On Thu, Jan 8, 2015 at 8:44 PM, Pavel Holoborodko <pavel@xxxxxxxxxxxxxxx> wrote:
How can I make Eigen use my own delete[]/new[] defined for custom scalar type?
Now Eigen uses its own allocators. 

Please confirm what functions should be specialized:

template<typename T> inline T* aligned_new(size_t size)
template<typename T> inline void aligned_delete(T *ptr, size_t size)

template<typename T, bool Align> inline T* conditional_aligned_new(size_t size)
template<typename T, bool Align> inline void conditional_aligned_delete(T *ptr, size_t size)
template<typename T, bool Align> inline T* conditional_aligned_realloc_new(T* pts, size_t new_size, size_t old_size)

Is it enough, or *_auto, *_stack and others should be taken care of too?



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/