10 #include <aws/core/SDKConfig.h>
19 #ifdef USE_AWS_MEMORY_MANAGEMENT
24 class Allocator :
public std::allocator<T>
28 typedef std::allocator<T> Base;
34 Allocator(
const Allocator<T>& a)
throw() :
39 Allocator(
const Allocator<U>& a)
throw() :
45 typedef std::size_t size_type;
50 typedef Allocator<U>
other;
53 typename Base::pointer allocate(size_type n,
const void *hint =
nullptr)
57 return reinterpret_cast<typename Base::pointer
>(
Malloc(
"AWSSTL", n *
sizeof(T)));
60 void deallocate(
typename Base::pointer p, size_type n)
70 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
71 template<
typename T >
72 bool operator ==(
const Allocator< T >& lhs,
const Allocator< T >& rhs)
79 #endif // _GLIBCXX_FULLY_DYNAMIC_STRING == 0
84 template<
typename T >
using Allocator = std::allocator<T>;
86 #endif // USE_AWS_MEMORY_MANAGEMENT
91 template<
typename T,
typename ...ArgTypes>
92 std::shared_ptr<T>
MakeShared(
const char* allocationTag, ArgTypes&&... args)
96 return std::allocate_shared<T, Aws::Allocator<T>>(
Aws::Allocator<T>(), std::forward<ArgTypes>(args)...);