LAMA
|
00001 00033 #ifndef LAMA_PGASSIMPLEALLOCATOR_HPP_ 00034 #define LAMA_PGASSIMPLEALLOCATOR_HPP_ 00035 00036 #include <lama/pgas/PGASAllocator.hpp> 00037 00038 #include <list> 00039 00040 namespace lama 00041 { 00042 00043 class PGASSimpleAllocator: public lama::PGASAllocator 00044 { 00045 private: 00046 void* mBasePointer; 00047 size_t mSize; 00048 void* mActualPointer; 00049 std::list<void*> mLastPtrs; 00050 size_t mFreeSpace; 00051 public: 00052 PGASSimpleAllocator(void* basepointer, size_t size); 00053 virtual ~PGASSimpleAllocator(); 00054 virtual void* allocate(size_t size); 00055 virtual void free(void* ptr, size_t size); 00056 void recalcFreeSpace(); 00057 virtual bool isAllocated(const void* ptr); 00058 virtual size_t getOffset(const void* ptr); 00059 }; 00060 00061 } /* namespace lama */ 00062 00063 #endif // LAMA_PGASSIMPLEALLOCATOR_HPP_