Removes MemoryDrillerBus

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-01 19:27:30 -08:00
parent c3f035c4e3
commit 59714fb31d
7 changed files with 2 additions and 77 deletions
@@ -10,7 +10,6 @@
#include <AzCore/Memory/BestFitExternalMapSchema.h>
#include <AzCore/Memory/AllocationRecords.h>
#include <AzCore/Memory/MemoryDrillerBus.h>
#include <AzCore/std/functional.h>
@@ -89,17 +88,6 @@ BestFitExternalMapAllocator::Allocate(size_type byteSize, size_type alignment, i
byteSize = MemorySizeAdjustedUp(byteSize);
BestFitExternalMapAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags);
if (address == nullptr)
{
if (!OnOutOfMemory(byteSize, alignment, flags, name, fileName, lineNum))
{
if (GetRecords())
{
EBUS_EVENT(Debug::MemoryDrillerBus, DumpAllAllocations);
}
}
}
AZ_Assert(address != nullptr, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum);
AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1));
@@ -1,52 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#ifndef AZCORE_MEMORY_DRILLER_BUS_H
#define AZCORE_MEMORY_DRILLER_BUS_H 1
#include <AzCore/Driller/DrillerBus.h>
namespace AZ
{
class IAllocator;
namespace Debug
{
//class AllocationRecords;
struct AllocationInfo;
/**
* Memory allocations driller message.
*
* We use a driller bus so all messages are sending in exclusive matter no other driller messages
* can be triggered at that moment, so we already preserve the calling order. You can assume
* all access code in the driller framework in guarded. You can manually lock the driller mutex are you
* use by using \ref AZ::Debug::DrillerEBusMutex.
*/
class MemoryDrillerMessages
: public AZ::Debug::DrillerEBusTraits
{
public:
virtual ~MemoryDrillerMessages() {}
/// Register allocation (with customizable tracking settings - TODO: we should centralize this settings and remove them from here)
virtual void RegisterAllocator(IAllocator* allocator) = 0;
virtual void UnregisterAllocator(IAllocator* allocator) = 0;
virtual void RegisterAllocation(IAllocator* allocator, void* address, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, unsigned int stackSuppressCount) = 0;
virtual void UnregisterAllocation(IAllocator* allocator, void* address, size_t byteSize, size_t alignment, AllocationInfo* info) = 0;
virtual void ReallocateAllocation(IAllocator* allocator, void* prevAddress, void* newAddress, size_t newByteSize, size_t newAlignment) = 0;
virtual void ResizeAllocation(IAllocator* allocator, void* address, size_t newSize) = 0;
virtual void DumpAllAllocations() = 0;
};
typedef AZ::EBus<MemoryDrillerMessages> MemoryDrillerBus;
} // namespace Debug
} // namespace AZ
#endif // AZCORE_MEMORY_DRILLER_BUS_H
#pragma once
@@ -12,9 +12,6 @@
#include <AzCore/Memory/PoolSchema.h>
#include <AzCore/Memory/AllocationRecords.h>
#include <AzCore/Memory/MemoryDrillerBus.h>
namespace AZ
{
template<class Allocator>
@@ -11,7 +11,6 @@
#include <AzCore/Memory/OSAllocator.h>
#include <AzCore/Memory/AllocationRecords.h>
#include <AzCore/Memory/MemoryDrillerBus.h>
#include <AzCore/std/functional.h>
@@ -248,14 +247,6 @@ SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, co
if (address == nullptr)
{
byteSize = MemorySizeAdjustedDown(byteSize); // restore original size
if (!OnOutOfMemory(byteSize, alignment, flags, name, fileName, lineNum))
{
if (GetRecords())
{
EBUS_EVENT(Debug::MemoryDrillerBus, DumpAllAllocations);
}
}
}
AZ_Assert(address != nullptr, "SystemAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum);
@@ -16,6 +16,7 @@
#include <AzCore/std/containers/vector.h>
#include <AzCore/std/containers/unordered_map.h>
#include <AzCore/std/parallel/binary_semaphore.h>
#include <aZcore/RTTI/RTTI.h>
namespace AZ
{
@@ -393,7 +393,6 @@ set(FILES
Memory/Memory.h
Memory/MemoryComponent.cpp
Memory/MemoryComponent.h
Memory/MemoryDrillerBus.h
Memory/nedmalloc.inl
Memory/NewAndDelete.inl
Memory/OSAllocator.cpp