![]() |
NEURON
|
Size and capacity in bytes. More...
#include <memory_usage.hpp>
Public Member Functions | |
| VectorMemoryUsage ()=default | |
| VectorMemoryUsage (size_t size, size_t capacity) | |
| template<class T , class A > | |
| VectorMemoryUsage (const std::vector< T, A > &vec) | |
Compute the memory requirements of the std::vector. More... | |
| const VectorMemoryUsage & | operator+= (const VectorMemoryUsage &other) |
Public Attributes | |
| size_t | size {} |
| Number of bytes used. More... | |
| size_t | capacity {} |
| Number of bytes allocated. More... | |
Size and capacity in bytes.
Definition at line 11 of file memory_usage.hpp.
|
default |
|
inline |
Definition at line 13 of file memory_usage.hpp.
|
inline |
Compute the memory requirements of the std::vector.
Note, this returns the size and capacity of the memory allocated by the std::vector. If the element allocate memory, that memory isn't included.
Essentially,
size = vec.size() * sizeof(T); capacity = vec.capacity() * sizeof(T);
Definition at line 29 of file memory_usage.hpp.
|
inline |
Definition at line 39 of file memory_usage.hpp.
| size_t neuron::container::VectorMemoryUsage::capacity {} |
Number of bytes allocated.
Definition at line 37 of file memory_usage.hpp.
| size_t neuron::container::VectorMemoryUsage::size {} |
Number of bytes used.
Definition at line 34 of file memory_usage.hpp.