![]() |
ATLAS Offline Software
|
Memory resource that monitors memory allocations and deallocations. More...
#include <MonitoredMemoryResource.h>
Public Member Functions | |
| MonitoredMemoryResource (std::pmr::memory_resource &upstream, IMemoryMonitorSvc &svc, const std::string &component, const std::string &device) | |
| Constructor. | |
| virtual | ~MonitoredMemoryResource () |
| Destructor. | |
Private Member Functions | |
Functions inherited from @c std::pmr::memory_resource | |
| virtual void * | do_allocate (std::size_t bytes, std::size_t alignment) override |
| Allocate memory from the resource. | |
| virtual void | do_deallocate (void *p, std::size_t bytes, std::size_t alignment) override |
| Deallocate memory from the resource. | |
| virtual bool | do_is_equal (const std::pmr::memory_resource &other) const noexcept override |
| Check if the resource is equal to another resource. | |
Private Attributes | |
Variables used to monitor the memory allocations/deallocations | |
| std::reference_wrapper< std::pmr::memory_resource > | m_upstream |
| The upstream memory resource to which the allocations are forwarded. | |
| std::reference_wrapper< IMemoryMonitorSvc > | m_svc |
| The service used to monitor the memory allocations/deallocations. | |
| std::string | m_component |
| The name of the component that is using this memory resource. | |
| std::string | m_device |
| The name of the device for which the memory resource is provided. | |
Memory resource that monitors memory allocations and deallocations.
It's an Athena specific wrapper around an upstream memory resource, which reports each of its memory (de)allocations to an IMemoryMonitorSvc service.
Definition at line 22 of file MonitoredMemoryResource.h.
| AthDevice::MonitoredMemoryResource::MonitoredMemoryResource | ( | std::pmr::memory_resource & | upstream, |
| IMemoryMonitorSvc & | svc, | ||
| const std::string & | component, | ||
| const std::string & | device ) |
Constructor.
Definition at line 10 of file MonitoredMemoryResource.cxx.
|
virtualdefault |
Destructor.
|
overrideprivatevirtual |
Allocate memory from the resource.
Definition at line 20 of file MonitoredMemoryResource.cxx.
|
overrideprivatevirtual |
Deallocate memory from the resource.
Definition at line 33 of file MonitoredMemoryResource.cxx.
|
overrideprivatevirtualnoexcept |
Check if the resource is equal to another resource.
Definition at line 43 of file MonitoredMemoryResource.cxx.
|
private |
The name of the component that is using this memory resource.
Definition at line 57 of file MonitoredMemoryResource.h.
|
private |
The name of the device for which the memory resource is provided.
Definition at line 59 of file MonitoredMemoryResource.h.
|
private |
The service used to monitor the memory allocations/deallocations.
Definition at line 55 of file MonitoredMemoryResource.h.
|
private |
The upstream memory resource to which the allocations are forwarded.
Definition at line 53 of file MonitoredMemoryResource.h.