30 lines
510 B
C++
30 lines
510 B
C++
/*
|
|
* MemoryManager.h
|
|
*
|
|
* Created on: Mar 16, 2014
|
|
* Author: robert
|
|
*/
|
|
|
|
#ifndef MEMORYMANAGER_H_
|
|
#define MEMORYMANAGER_H_
|
|
|
|
#include <tlm.h>
|
|
#include <vector>
|
|
typedef tlm::tlm_generic_payload gp;
|
|
|
|
class MemoryManager : public tlm::tlm_mm_interface
|
|
{
|
|
public:
|
|
MemoryManager();
|
|
virtual ~MemoryManager();
|
|
virtual gp* allocate();
|
|
virtual void free(gp* payload);
|
|
|
|
private:
|
|
unsigned int numberOfAllocations;
|
|
unsigned int numberOfFrees;
|
|
std::vector<gp*> freePayloads;
|
|
};
|
|
|
|
#endif /* MEMORYMANAGER_H_ */
|