20 #include <aws/core/SDKConfig.h> 29 #ifdef USE_AWS_MEMORY_MANAGEMENT 34 class Allocator :
public std::allocator<T>
38 typedef std::allocator<T> Base;
44 Allocator(
const Allocator<T>& a)
throw() :
49 Allocator(
const Allocator<U>& a)
throw() :
55 typedef std::size_t size_type;
60 typedef Allocator<U>
other;
63 typename Base::pointer allocate(size_type n,
const void *hint =
nullptr)
67 return reinterpret_cast<typename Base::pointer
>(
Malloc(
"AWSSTL", n *
sizeof(T)));
70 void deallocate(
typename Base::pointer p, size_type n)
80 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 81 template<
typename T >
82 bool operator ==(
const Allocator< T >& lhs,
const Allocator< T >& rhs)
89 #endif // _GLIBCXX_FULLY_DYNAMIC_STRING == 0 94 template<
typename T >
using Allocator = std::allocator<T>;
96 #endif // USE_AWS_MEMORY_MANAGEMENT 101 template<
typename T,
typename ...ArgTypes>
102 std::shared_ptr<T>
MakeShared(
const char* allocationTag, ArgTypes&&... args)
106 return std::allocate_shared<T, Aws::Allocator<T>>(
Aws::Allocator<T>(), std::forward<ArgTypes>(args)...);
std::allocator< T > Allocator
#define AWS_UNREFERENCED_PARAM(x)
AWS_CORE_API void Free(void *memoryPtr)
AWS_CORE_API void * Malloc(const char *allocationTag, size_t allocationSize)
JSON (JavaScript Object Notation).
std::shared_ptr< T > MakeShared(const char *allocationTag, ArgTypes &&...args)