Keep track of allocations and their type.
More...
#include <MemoryManager.hpp>
Keep track of allocations and their type.
◆ MemoryManager() [1/2]
Construct a new Memory Manager.
- Parameters
-
| dataTypeInator | type resolver machine |
◆ ~MemoryManager()
| MemoryManager::~MemoryManager |
( |
| ) |
|
◆ MemoryManager() [2/2]
◆ clear_all_vars()
| void MemoryManager::clear_all_vars |
( |
| ) |
|
Clear all variables registered with the memory manager.
◆ clear_var() [1/2]
| void MemoryManager::clear_var |
( |
const std::string & |
var_name | ) |
|
Clear the variable with the given name, if it is registered with the memorymanager.
- Parameters
-
| var_name | name of variable to clear |
◆ clear_var() [2/2]
| void MemoryManager::clear_var |
( |
void * |
address | ) |
|
Clear the value at the given address, if it is registered with the memorymanager.
- Parameters
-
| address | address of variable to clear |
◆ declare_var()
| void * MemoryManager::declare_var |
( |
const std::string & |
declaration, |
|
|
void * |
suppliedAllocation = NULL |
|
) |
| |
Declare a new allocation of given type with the memory manager.
- Parameters
-
| declaration | string representation of the type of this allocation |
| suppliedAllocation | pre-existing allocation. If not given, the memory manager will allocate one |
- Returns
- void* address of the allocation (same as suppliedAllocation if one was given). NULL if something goes wrong
◆ delete_var() [1/2]
| void MemoryManager::delete_var |
( |
std::string |
var_name | ) |
|
Delete the variable.
- Parameters
-
| var_name | name of variable to delete |
◆ delete_var() [2/2]
| void MemoryManager::delete_var |
( |
void * |
address | ) |
|
Delete the variable.
- Parameters
-
| address | address of variable to delete |
◆ getAllocInfoAt()
| AllocInfo * MemoryManager::getAllocInfoAt |
( |
void * |
address | ) |
|
Get the AllocInfo that starts at the given address.
- Parameters
-
| address | address to search for |
- Returns
- AllocInfo* Alloc info that starts at this address, or NULL if not found
◆ getAllocInfoNamed()
| AllocInfo * MemoryManager::getAllocInfoNamed |
( |
const std::string & |
name | ) |
|
Get the AllocInfo with the given name.
- Parameters
-
- Returns
- AllocInfo* AllocInfo with the given name, or NULL if not found
◆ getAllocInfoOf()
| AllocInfo * MemoryManager::getAllocInfoOf |
( |
void * |
address | ) |
|
Get the AllocInfo that contains the given address.
- Parameters
-
| address | address to search for |
- Returns
- AllocInfo* Alloc info that contains this address, or NULL if not found
◆ getDataTypeOf()
| std::shared_ptr< const DataType > MemoryManager::getDataTypeOf |
( |
const std::string & |
name | ) |
|
Get the DataType of the given variable.
- Parameters
-
| name | variable name to search for |
- Returns
- std::shared_ptr<const DataType> type of variable, or NULL if not found
◆ restore_checkpoint() [1/2]
| void MemoryManager::restore_checkpoint |
( |
const std::string & |
filename | ) |
|
Restore a checkpoint from file with given name.
- Parameters
-
| filename | name of file to read from |
◆ restore_checkpoint() [2/2]
| void MemoryManager::restore_checkpoint |
( |
std::istream & |
in_s | ) |
|
Restore a checkpoint from the given input stream.
- Parameters
-
| in_s | stream to restore from |
◆ setCheckPointAgent()
Set the CheckPointAgent.
- Parameters
-
| agent | new CheckpointAgent object to use |
◆ var_exists()
| bool MemoryManager::var_exists |
( |
const std::string & |
var_name | ) |
|
Check if a variable is registered with the memory manager.
- Parameters
-
| var_name | variable to look for |
- Returns
- true if var exists, false otherwise
◆ write_checkpoint() [1/2]
| void MemoryManager::write_checkpoint |
( |
const std::string & |
filename | ) |
|
Open a file and then write a checkpoint to it.
- Parameters
-
| filename | name of file to write to |
◆ write_checkpoint() [2/2]
| void MemoryManager::write_checkpoint |
( |
std::ostream & |
out_s | ) |
|
Write checkpoint to an output stream.
- Parameters
-
The documentation for this class was generated from the following files: