Fixes Linux build

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-11-30 18:11:08 -08:00
parent f062b563c8
commit 0f5cb54a38
3 changed files with 8 additions and 11 deletions
@@ -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<TAllocator>
{
using base = AllocatorBenchmarkFixture<TAllocator>;
using TestAllocatorType = base::TestAllocatorType;
using TestAllocatorType = typename base::TestAllocatorType;
void internalSetUp(const ::benchmark::State& state) override
{
@@ -406,7 +402,7 @@ namespace Benchmark
: public AllocatorBenchmarkFixture<TAllocator>
{
using base = AllocatorBenchmarkFixture<TAllocator>;
using TestAllocatorType = base::TestAllocatorType;
using TestAllocatorType = typename base::TestAllocatorType;
void internalSetUp(const ::benchmark::State& state) override
{
@@ -10,7 +10,7 @@
#include <AzCore/Debug/Trace.h>
#include <malloc.h>
#include <stdio.h>
#include <sys/resource.h>
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;
}
}
}
@@ -9,7 +9,8 @@
#include <AzCore/PlatformIncl.h>
#include <AzCore/Debug/Trace.h>
#include <mach/mach.h>
#include <malloc.h>
#include <sys/resource.h>
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;
}
}
}