From 0f5cb54a38d32abacc29f1bc23d58d6032384bb6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:11:08 -0800 Subject: [PATCH] Fixes Linux build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 10 +++------- .../Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp | 4 ++-- .../Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 5 +++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index c1fdd4ca32..dfaefd4c0f 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -248,10 +248,6 @@ namespace Benchmark { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); - - TestSystemAllocator() - : AZ::SystemAllocator() - {} }; // Allocated bytes reported by the allocator / actually requested bytes @@ -293,7 +289,7 @@ namespace Benchmark m_allocations.resize(state.threads); for (auto& perThreadAllocations : m_allocations) { - perThreadAllocations.resize(state.range_x(), nullptr); + perThreadAllocations.resize(state.range(0), nullptr); } } } @@ -342,7 +338,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { @@ -406,7 +402,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp index 49ecefda49..636d5519d8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace Benchmark { @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 374d9f81f7..303b7efbb4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,8 @@ #include #include -#include +#include +#include namespace Benchmark { @@ -24,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } }