28#ifndef VC_COMMON_MAKE_UNIQUE_H_
29#define VC_COMMON_MAKE_UNIQUE_H_
34namespace Vc_VERSIONED_NAMESPACE
39template<
typename T>
struct Deleter
41 Vc_ALWAYS_INLINE
void operator()(T *ptr) {
48inline std::unique_ptr<T, Deleter<T>> make_unique(Args&&... args)
50 return std::unique_ptr<T, Deleter<T>>(
new(
Vc::malloc<T, A>(1)) T(std::forward<Args>(args)...));
void free(T *p)
Frees memory that was allocated with Vc::malloc.
T * malloc(size_t n)
Allocates memory on the Heap with alignment and padding suitable for vectorized access.
MallocAlignment
Enum that specifies the alignment and padding restrictions to use for memory allocation with Vc::mall...
@ AlignOnVector
Align on boundary of vector sizes (e.g.