diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-02-18 18:51:24 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-02-18 18:51:24 -0800 |
commit | cbd7e98174127a52d4d76bec4394316548bb31e5 (patch) | |
tree | cc14b314fc0b32591eeb88845d259591b1b37129 /Eigen/src/Core/util/Memory.h | |
parent | 7ed9441ea472031bb9357b5bec80151cae7ed2cb (diff) | |
parent | 37a1d736bfd6fdaa0e1a93aee585d1861ab4004a (diff) |
Merged the latest version of the code from eigen/eigen
Diffstat (limited to 'Eigen/src/Core/util/Memory.h')
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 2f2398bbf..88cf1c30d 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -608,7 +608,7 @@ template<typename T> class aligned_stack_memory_handler */ #ifdef EIGEN_ALLOCA // The native alloca() that comes with llvm aligns buffer on 16 bytes even when AVX is enabled. - #if defined(__arm__) || EIGEN_ALIGN_BYTES > 16 +#if defined(__arm__) || defined(_WIN32) || EIGEN_ALIGN_BYTES > 16 #define EIGEN_ALIGNED_ALLOCA(SIZE) reinterpret_cast<void*>((reinterpret_cast<size_t>(EIGEN_ALLOCA(SIZE+EIGEN_ALIGN_BYTES)) & ~(size_t(EIGEN_ALIGN_BYTES-1))) + EIGEN_ALIGN_BYTES) #else #define EIGEN_ALIGNED_ALLOCA EIGEN_ALLOCA @@ -761,11 +761,27 @@ public: ::new( p ) T( value ); } +#if (__cplusplus >= 201103L) + template <typename U, typename... Args> + void construct( U* u, Args&&... args) + { + ::new( static_cast<void*>(u) ) U( std::forward<Args>( args )... ); + } +#endif + void destroy( pointer p ) { p->~T(); } +#if (__cplusplus >= 201103L) + template <typename U> + void destroy( U* u ) + { + u->~U(); + } +#endif + void deallocate( pointer p, size_type /*num*/ ) { internal::aligned_free( p ); |