Commit 9051b473 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:4127] #4020 Add function toku_mempool_get_allocated_space()

git-svn-id: file:///svn/toku/tokudb@36823 c7de825b-a66e-492c-adef-691d508d4ae1
parent d59b7aa8
...@@ -97,6 +97,10 @@ size_t toku_mempool_get_free_space(struct mempool *mp) { ...@@ -97,6 +97,10 @@ size_t toku_mempool_get_free_space(struct mempool *mp) {
return mp->size - mp->free_offset; return mp->size - mp->free_offset;
} }
size_t toku_mempool_get_allocated_space(struct mempool *mp) {
return mp->free_offset;
}
void *toku_mempool_malloc(struct mempool *mp, size_t size, int alignment) { void *toku_mempool_malloc(struct mempool *mp, size_t size, int alignment) {
invariant(size < (1U<<31)); invariant(size < (1U<<31));
invariant(mp->size < (1U<<31)); invariant(mp->size < (1U<<31));
......
...@@ -64,6 +64,8 @@ size_t toku_mempool_get_used_space(struct mempool *mp); ...@@ -64,6 +64,8 @@ size_t toku_mempool_get_used_space(struct mempool *mp);
/* get the amount of space that is available for new data */ /* get the amount of space that is available for new data */
size_t toku_mempool_get_free_space(struct mempool *mp); size_t toku_mempool_get_free_space(struct mempool *mp);
/* get the amount of space that has been allocated for use (wasted or not) */
size_t toku_mempool_get_allocated_space(struct mempool *mp);
/* allocate a chunk of memory from the memory pool suitably aligned */ /* allocate a chunk of memory from the memory pool suitably aligned */
void *toku_mempool_malloc(struct mempool *mp, size_t size, int alignment); void *toku_mempool_malloc(struct mempool *mp, size_t size, int alignment);
......
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