What is the purpose of the "allocationTag" parameter in the AWS SDK for C++?
Asked Answered
D

1

10

The AWS memory allocation functions, Aws::MakeShared, Aws::MakeUnique, Aws::MakeUniqueArray, Aws::Malloc, Aws::New, and Aws::NewArray all require a const char * allocationTag argument to be provided, however, it's unclear exactly what this string is used for.

The AWS SDK for C++ documentation on Aws::MakeShared says:

"...allocationTag is for memory tracking purposes."

But how exactly is allocationTag being used for memory tracking? Is there a guideline for what allocationTags values to use with the AWS memory management functions?

Disgruntle answered 1/7, 2019 at 18:57 Comment(0)
A
3

I just stumbled across the answer to this on the "Q&A" section of the GitHub repo.

https://github.com/aws/aws-sdk-cpp/discussions/2031

TLDR: It's a special tag that is used to track allocations, it will be logged if your API configuration allows it.

Alewife answered 12/10, 2022 at 16:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.