MCPcopy Create free account
hub / github.com/PX4/eigen / conditional_aligned_new_auto

Function conditional_aligned_new_auto

Eigen/src/Core/util/Memory.h:369–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367
368
369template<typename T, bool Align> EIGEN_DEVICE_FUNC inline T* conditional_aligned_new_auto(std::size_t size)
370{
371 if(size==0)
372 return 0; // short-cut. Also fixes Bug 884
373 check_size_for_overflow<T>(size);
374 T *result = reinterpret_cast<T*>(conditional_aligned_malloc<Align>(sizeof(T)*size));
375 if(NumTraits<T>::RequireInitialization)
376 {
377 EIGEN_TRY
378 {
379 construct_elements_of_array(result, size);
380 }
381 EIGEN_CATCH(...)
382 {
383 conditional_aligned_free<Align>(result);
384 EIGEN_THROW;
385 }
386 }
387 return result;
388}
389

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected