Commit 97ee3f90 authored by David COME's avatar David COME
Browse files

MemoryManager can now return the nominal capacity of one block

parent b10ce4d2
......@@ -47,12 +47,21 @@ public:
* @param numberOfBlocks: number of blocks to allocate
* @param blockSize: size of each block
*/
MemoryManager(const size_t numberOfBlocks, const size_t blockSize) throw(castor::exception::Exception) : m_totalNumberOfBlocks(numberOfBlocks) {
MemoryManager(const size_t numberOfBlocks, const size_t blockSize) throw(castor::exception::Exception) :
m_blockCapacity(blockSize),m_totalNumberOfBlocks(numberOfBlocks) {
for (size_t i = 0; i < numberOfBlocks; i++) {
m_freeBlocks.push(new MemBlock(i, blockSize));
}
}
/**
*
* @return the nominal capacity of one block
*/
size_t blockCapacity(){
return m_blockCapacity;
}
/**
* Are all sheep back to the farm?
* @return
......@@ -133,6 +142,8 @@ private:
}
};
const size_t m_blockCapacity;
/**
* Total number of allocated memory blocks
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment