Commit 947eb6bf authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4128], change toku_bnc_memory_size to report number of bytes used in buffer

git-svn-id: file:///svn/toku/tokudb@36828 c7de825b-a66e-492c-adef-691d508d4ae1
parent f651290f
......@@ -494,7 +494,7 @@ long
toku_bnc_memory_size(NONLEAF_CHILDINFO bnc)
{
return (sizeof(*bnc) +
toku_fifo_memory_size(bnc->buffer) +
toku_fifo_memory_size_in_use(bnc->buffer) +
toku_omt_memory_size(bnc->fresh_message_tree) +
toku_omt_memory_size(bnc->stale_message_tree) +
toku_omt_memory_size(bnc->broadcast_list));
......
......@@ -204,6 +204,10 @@ void toku_fifo_size_is_stabilized(FIFO fifo) {
}
}
unsigned long toku_fifo_memory_size_in_use(FIFO fifo) {
return sizeof(*fifo)+fifo->memory_start+fifo->memory_used;
}
unsigned long toku_fifo_memory_size(FIFO fifo) {
return sizeof(*fifo)+fifo->memory_size;
}
......
......@@ -56,7 +56,9 @@ int toku_fifo_deq(FIFO); // we cannot deq items anymore, since their offsets ar
// THIS ONLY REMAINS FOR TESTING, DO NOT USE IT IN CODE
int toku_fifo_empty(FIFO); // don't deallocate the memory for the fifo
unsigned long toku_fifo_memory_size(FIFO); // return how much memory the fifo uses.
unsigned long toku_fifo_memory_size_in_use(FIFO fifo); // return how much memory the fifo uses.
unsigned long toku_fifo_memory_size(FIFO); // return how much memory fifo has allocated
//These two are problematic, since I don't want to malloc() the bytevecs, but dequeueing the fifo frees the memory.
//int toku_fifo_peek_deq (FIFO, bytevec *key, ITEMLEN *keylen, bytevec *data, ITEMLEN *datalen, u_int32_t *type, TXNID *xid);
......
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