Celeritas
0.5.0-86+4a8eea4
|
Record the change in memory usage between construction and destruction. More...
#include <ScopedMem.hh>
Public Member Functions | |
ScopedMem (std::string_view label, MemRegistry *registry) | |
Construct with name and a pointer to the mem registry. | |
ScopedMem (std::string_view label) | |
Construct with name and default registry. | |
~ScopedMem () noexcept(!CELERITAS_DEBUG) | |
Register data on destruction. | |
CELER_DEFAULT_MOVE_DELETE_COPY (ScopedMem) | |
Prevent copying but allow moving. | |
Record the change in memory usage between construction and destruction.
This class is not thread safe because it writes to a shared global index. In a multithreaded environment a "null" scoped memory can be used: