Refactor force-inlining macros and use EIGEN_ALWAYS_INLINE to force inlining of the integer overflow helpers, whose non-inlining caused major performance problems, see the mailing list thread 'Significant perf regression probably due to bug #363 patches'

This commit is contained in:
Benoit Jacob
2011-11-06 16:27:41 -05:00
parent aa3e420df5
commit 1b98b73472
4 changed files with 20 additions and 17 deletions

View File

@@ -354,7 +354,7 @@ template<typename T> inline void destruct_elements_of_array(T *ptr, size_t size)
*****************************************************************************/
template<typename T>
inline void check_size_for_overflow(size_t size)
EIGEN_ALWAYS_INLINE void check_size_for_overflow(size_t size)
{
if(size > size_t(-1) / sizeof(T))
throw_std_bad_alloc();