Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
97ee3f90
Commit
97ee3f90
authored
Apr 14, 2014
by
David COME
Browse files
MemoryManager can now return the nominal capacity of one block
parent
b10ce4d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/MemManager.hpp
View file @
97ee3f90
...
...
@@ -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
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment