AWS SDK for C++  1.9.105
AWS SDK for C++
AWSAllocator.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 
10 #include <aws/core/SDKConfig.h>
13 #include <aws/crt/StlAllocator.h>
14 
15 #include <memory>
16 #include <cstdlib>
17 
18 namespace Aws
19 {
20 #ifdef USE_AWS_MEMORY_MANAGEMENT
21 
22  template< typename T > using Allocator = Aws::Crt::StlAllocator<T>;
23 
24 #ifdef __ANDROID__
25 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
26  template< typename T >
27  bool operator ==(const Allocator< T >& lhs, const Allocator< T >& rhs)
28  {
31 
32  return false;
33  }
34 #endif // _GLIBCXX_FULLY_DYNAMIC_STRING == 0
35 #endif // __ANDROID__
36 
37 #else
38 
39  template< typename T > using Allocator = std::allocator<T>;
40 
41 #endif // USE_AWS_MEMORY_MANAGEMENT
42 
46  template<typename T, typename ...ArgTypes>
47  std::shared_ptr<T> MakeShared(const char* allocationTag, ArgTypes&&... args)
48  {
49  AWS_UNREFERENCED_PARAM(allocationTag);
50 
51  return std::allocate_shared<T, Aws::Allocator<T>>(Aws::Allocator<T>(), std::forward<ArgTypes>(args)...);
52  }
53 
54 
55 } // namespace Aws
Aws::Allocator
std::allocator< T > Allocator
Definition: AWSAllocator.h:39
Aws::MakeShared
std::shared_ptr< T > MakeShared(const char *allocationTag, ArgTypes &&... args)
Definition: AWSAllocator.h:47
MemorySystemInterface.h
AWS_UNREFERENCED_PARAM
#define AWS_UNREFERENCED_PARAM(x)
Definition: UnreferencedParam.h:16
Core_EXPORTS.h
Aws
Definition: AccessManagementClient.h:15
AWSMemory.h