1 #ifndef hamr_malloc_allocator_h
2 #define hamr_malloc_allocator_h
4 #include "hamr_config.h"
12 template <
typename T,
typename E =
void>
17 class HAMR_EXPORT
malloc_deleter<T, typename std::enable_if<!std::is_arithmetic<T>::value>::type>
30 void operator()(T *ptr);
44 class HAMR_EXPORT
malloc_deleter<T, typename std::enable_if<std::is_arithmetic<T>::value>::type>
57 void operator()(T *ptr);
70 template <
typename T,
typename E =
void>
75 struct HAMR_EXPORT
malloc_allocator<T, typename std::enable_if<!std::is_arithmetic<T>::value>::type>
81 static std::shared_ptr<T> allocate(
size_t n) HAMR_EXPORT;
89 static std::shared_ptr<T> allocate(
size_t n,
const T &val) HAMR_EXPORT;
97 static std::shared_ptr<T> allocate(
size_t n,
const U *vals) HAMR_EXPORT;
105 template <
typename T>
106 struct HAMR_EXPORT
malloc_allocator<T, typename std::enable_if<std::is_arithmetic<T>::value>::type>
112 static std::shared_ptr<T> allocate(
size_t n) HAMR_EXPORT;
119 static std::shared_ptr<T> allocate(
size_t n,
const T &val) HAMR_EXPORT;
126 template <
typename U>
127 static std::shared_ptr<T> allocate(
size_t n,
const U *vals) HAMR_EXPORT;
132 #if !defined(HAMR_SEPARATE_IMPL)
133 #include "hamr_malloc_allocator_impl.h"