Celeritas
0.5.0-56+6b053cd
|
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 () | |
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: