Psi4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
psi::MemoryManager Class Reference

#include <memory_manager.h>

Public Member Functions

 MemoryManager (size_t maxcor=256000000)
 
 ~MemoryManager ()
 
void MemCheck (std::string output)
 
size_t get_FreeMemory () const
 
size_t get_CurrentAllocated () const
 
size_t get_MaximumAllowedMemory () const
 
template<typename T >
void allocate (const char *type, T *&matrix, size_t size, const char *variableName, const char *fileName, size_t lineNumber)
 
template<typename T >
void release_one (T *&matrix, const char *fileName, size_t lineNumber)
 
template<typename T >
void allocate (const char *type, T **&matrix, size_t size1, size_t size2, const char *variableName, const char *fileName, size_t lineNumber)
 
template<typename T >
void release_two (T **&matrix, const char *fileName, size_t lineNumber)
 
template<typename T >
void allocate (const char *type, T ***&matrix, size_t size1, size_t size2, size_t size3, const char *variableName, const char *fileName, size_t lineNumber)
 
template<typename T >
void release_three (T ***&matrix, const char *fileName, size_t lineNumber)
 

Private Member Functions

void RegisterMemory (void *mem, AllocationEntry &entry, size_t size)
 
void UnregisterMemory (void *mem, size_t size, const char *fileName, size_t lineNumber)
 

Private Attributes

size_t CurrentAllocated
 
size_t MaximumAllocated
 
size_t MaximumAllowed
 
std::map< void *, AllocationEntryAllocationTable
 

Constructor & Destructor Documentation

psi::MemoryManager::MemoryManager ( size_t  maxcor = 256000000)
psi::MemoryManager::~MemoryManager ( )

Member Function Documentation

template<typename T >
void psi::MemoryManager::allocate ( const char *  type,
T *&  matrix,
size_t  size,
const char *  variableName,
const char *  fileName,
size_t  lineNumber 
)
template<typename T >
void psi::MemoryManager::allocate ( const char *  type,
T **&  matrix,
size_t  size1,
size_t  size2,
const char *  variableName,
const char *  fileName,
size_t  lineNumber 
)
template<typename T >
void psi::MemoryManager::allocate ( const char *  type,
T ***&  matrix,
size_t  size1,
size_t  size2,
size_t  size3,
const char *  variableName,
const char *  fileName,
size_t  lineNumber 
)
size_t psi::MemoryManager::get_CurrentAllocated ( ) const
inline
size_t psi::MemoryManager::get_FreeMemory ( ) const
inline
size_t psi::MemoryManager::get_MaximumAllowedMemory ( ) const
inline
void psi::MemoryManager::MemCheck ( std::string  output)
void psi::MemoryManager::RegisterMemory ( void *  mem,
AllocationEntry entry,
size_t  size 
)
private
template<typename T >
void psi::MemoryManager::release_one ( T *&  matrix,
const char *  fileName,
size_t  lineNumber 
)
template<typename T >
void psi::MemoryManager::release_three ( T ***&  matrix,
const char *  fileName,
size_t  lineNumber 
)
template<typename T >
void psi::MemoryManager::release_two ( T **&  matrix,
const char *  fileName,
size_t  lineNumber 
)
void psi::MemoryManager::UnregisterMemory ( void *  mem,
size_t  size,
const char *  fileName,
size_t  lineNumber 
)
private

Member Data Documentation

std::map<void *, AllocationEntry> psi::MemoryManager::AllocationTable
private
size_t psi::MemoryManager::CurrentAllocated
private
size_t psi::MemoryManager::MaximumAllocated
private
size_t psi::MemoryManager::MaximumAllowed
private

The documentation for this class was generated from the following files: