Skip to content

Commit f5f5e87

Browse files
sdavtakersbiscigl
authored andcommitted
Added lost usage of USE_AWS_MEMORY_MANAGEMENT
1 parent 65fb259 commit f5f5e87

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/Memory_Management.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Memory Management
22
The AWS SDK for C++ provides a way to control memory allocation and deallocation in a library.
33

4-
Custom memory management is available only if you use a version of the library built using the compile-time constant AWS_CUSTOM_MEMORY_MANAGEMENT defined.
4+
Custom memory management is available only if you use a version of the library built using the compile-time constant USE_AWS_MEMORY_MANAGEMENT defined.
55

66
If you use a version of the library built without the compile-time constant, the global memory system functions such as InitializeAWSMemorySystem will not work and the global new and delete functions will be used instead.
77

@@ -48,7 +48,7 @@ When initialized with a memory manager, the AWS SDK for C++ defers all allocatio
4848
4949
If you use custom STL allocators, you must alter the type signatures for all STL objects to match the allocation policy. Because STL is used prominently in the SDK implementation and interface, a single approach in the SDK would inhibit direct passing of default STL objects into the SDK or control of STL allocation. Alternately, a hybrid approach – using custom allocators internally and allowing standard and custom STL objects on the interface – could potentially cause more difficulty when investigating memory issues.
5050
51-
The solution is to use the memory system’s compile-time constant AWS_CUSTOM_MEMORY_MANAGEMENT to control which STL types the SDK will use.
51+
The solution is to use the memory system’s compile-time constant USE_AWS_MEMORY_MANAGEMENT to control which STL types the SDK will use.
5252
5353
If the compile-time constant is enabled (on), the types resolve to STL types with a custom allocator connected to the AWS memory system.
5454
@@ -57,7 +57,7 @@ If the compile-time constant is disabled (off), all Aws::* types resolve to the
5757
Example code from the AWSAllocator.h file in the SDK:
5858
5959
```cpp
60-
#ifdef AWS_CUSTOM_MEMORY_MANAGEMENT
60+
#ifdef USE_AWS_MEMORY_MANAGEMENT
6161
6262
template< typename T >
6363
class AwsAllocator : public std::allocator< T >

docs/SDK_usage_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Several directories are appended with \*integration-tests. After building your p
88

99
## Build Defines
1010
If you dynamically link to the SDK you will need to define the USE_IMPORT_EXPORT symbol for all build targets using the SDK.
11-
If you wish to install your own memory manager to handle allocations made by the SDK, you will need to pass the CUSTOM_MEMORY_MANAGEMENT cmake parameter (-DCUSTOM_MEMORY_MANAGEMENT) as well as define AWS_CUSTOM_MEMORY_MANAGEMENT in all build targets dependent on the SDK.
11+
If you wish to install your own memory manager to handle allocations made by the SDK, you will need to pass the CUSTOM_MEMORY_MANAGEMENT cmake parameter (-DCUSTOM_MEMORY_MANAGEMENT) as well as define USE_AWS_MEMORY_MANAGEMENT in all build targets dependent on the SDK.
1212

1313
Note, if you use our export file, this will be handled automatically for you. We recommend you use our export file to handle this for you:
1414
https://aws.amazon.com/blogs/developer/using-cmake-exports-with-the-aws-sdk-for-c/

src/aws-cpp-sdk-core/source/client/RequestCompression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void aws_zfree(void * /* opaque */, void * ptr)
7474
}
7575
}
7676

77-
#endif // AWS_CUSTOM_MEMORY_MANAGEMENT
77+
#endif // USE_AWS_MEMORY_MANAGEMENT
7878
#endif // ENABLED_ZLIB_REQUEST_COMPRESSION
7979

8080

src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using namespace Aws::Utils;
2525
using namespace Aws::Utils::Logging;
2626
using namespace Aws::Monitoring;
2727

28-
#ifdef AWS_CUSTOM_MEMORY_MANAGEMENT
28+
#ifdef USE_AWS_MEMORY_MANAGEMENT
2929

3030
static const char* MemTag = "libcurl";
3131
static size_t offset = sizeof(size_t);
@@ -505,7 +505,7 @@ void CurlHttpClient::InitGlobalState()
505505
AWS_LOGSTREAM_INFO(CURL_HTTP_CLIENT_TAG, "Initializing Curl library with version: " << curlVersionData->version
506506
<< ", ssl version: " << curlVersionData->ssl_version);
507507
isInit = true;
508-
#ifdef AWS_CUSTOM_MEMORY_MANAGEMENT
508+
#ifdef USE_AWS_MEMORY_MANAGEMENT
509509
curl_global_init_mem(CURL_GLOBAL_ALL, &malloc_callback, &free_callback, &realloc_callback, &strdup_callback, &calloc_callback);
510510
#else
511511
curl_global_init(CURL_GLOBAL_ALL);

0 commit comments

Comments
 (0)