Commit 6835e832 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1577 Fix calculation of total memory size of a memarena

Use size of memarena struct instead of memarena pointer.
Include size of the 'other_bufs' array in size calculation.

git-svn-id: file:///svn/toku/tokudb@10500 c7de825b-a66e-492c-adef-691d508d4ae1
parent dafa5e8d
......@@ -140,7 +140,9 @@ void memarena_move_buffers(MEMARENA dest, MEMARENA source) {
size_t
memarena_total_memory_size (MEMARENA m)
{
return m->size_of_other_bufs + m->buf_size + sizeof(m);
return (memarena_total_size_in_use(m) +
sizeof(*m) +
m->n_other_bufs * sizeof(*m->other_bufs));
}
size_t
......
Markdown is supported
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