From 5dece85092334809d80c3d1ed3dc093f20d0dc33 Mon Sep 17 00:00:00 2001 From: Michael Stetsyuk Date: Fri, 11 Sep 2026 11:57:29 +0000 Subject: [PATCH] Route allocate_at_least through the custom memory manager Under C++23 libc++, `std::allocator_traits::allocate_at_least` picks up the inherited `std::allocator::allocate_at_least`, so `basic_string` and `vector` growth bypassed `Aws::Malloc`. Co-Authored-By: Claude Fable 5.1 --- .../include/aws/core/utils/memory/stl/AWSAllocator.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h b/src/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h index efa1c8340f84..2043b83de2b3 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h +++ b/src/aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h @@ -71,6 +71,13 @@ namespace Aws return reinterpret_cast(Malloc("AWSSTL", n * sizeof(T))); } +#if defined(__cpp_lib_allocate_at_least) + std::allocation_result allocate_at_least(size_type n) + { + return {allocate(n), n}; + } +#endif + void deallocate(RawPointer p, size_type n) { AWS_UNREFERENCED_PARAM(n);