Go to the source code of this file.
Namespaces | |
| namespace | cmtk |
| namespace | cmtk::Memory |
Memory-related helper functions. | |
Functions | |
| size_t | cmtk::Memory::GetNextPowerOfTwo (size_t k) |
| Utility function: get next power of two. | |
| template<class T > | |
| T * | cmtk::Memory::AllocateArray (const size_t size) |
| Memory allocation for array. | |
| template<class T > | |
| void | cmtk::Memory::DeleteArray (T *const array) |
| Delete an array allocated using AllocateArray(). | |
| template<class T > | |
| void | cmtk::Memory::Set (T *const to, const T value, const size_t length) |
| Set (fill) memory region with given value. | |
| template<class T > | |
| void | cmtk::Memory::Copy (T *const to, const T *from, const size_t length) |
| Copy memory region. | |
| template<class T > | |
| T | cmtk::Memory::ByteSwap (T value) |
| Byte-swap arbitrary value. | |
| template<class T > | |
| void | cmtk::Memory::ByteSwapInPlace (T &value) |
| Byte-swap arbitrary value in place. | |
Functions for tracing memory allocation and de-allocation. | |
These functions can be used to watch the amount of memory allocated and freed by other functions. Memory holes can be identified and located. | |
| size_t | cmtk::Memory::Used () |
| Get amount of memory used. | |
| void | cmtk::Memory::Info (const char *msg=NULL) |
| Print memory usage. | |
| void | cmtk::Memory::Diff (const size_t before, const char *msg) |
| Print difference of memory usage. | |
1.7.2