Statistics memory resource. More...
#include <playrho/pmr/StatsResource.hpp>
Classes | |
| struct | Stats |
| Statistics collected. More... | |
Public Member Functions | |
| StatsResource (memory_resource *resource=new_delete_resource()) noexcept | |
| Initializing constructor. More... | |
| Stats | GetStats () const noexcept |
| Gets the currently collected statistics. | |
| pmr::memory_resource * | upstream_resource () const noexcept |
| Returns a pointer to the upstream resource set on construction. | |
Public Member Functions inherited from playrho::pmr::memory_resource | |
| memory_resource ()=default | |
| Default constructor. | |
| memory_resource (const memory_resource &)=default | |
| Copy constructor. | |
| virtual | ~memory_resource () |
| Destructor. | |
| void * | allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t)) |
| Allocates memory. | |
| void | deallocate (void *p, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t)) |
| Deallocates memory. | |
| bool | is_equal (const memory_resource &other) const noexcept |
| Compare for equality with other resource. | |
Statistics memory resource.
Forwards allocation and deallocation calls to the configured upstream memory resource, and collects statistics on successful calls.
|
inlinenoexcept |
Initializing constructor.
upstream_resource() returns the resource given.