diff options
author | 3gg <3gg@shellblade.net> | 2023-07-16 16:31:59 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2023-07-16 16:31:59 -0700 |
commit | ecc2645ba4c44005ef13e33c79059de69b76551f (patch) | |
tree | 0a440aa55cf81d61688bbd34dfe8f07c39e55171 /mempool/src/mempool.c | |
parent | f48986597e6ff092feb0f18a79c6fa51a3f0e3bb (diff) |
Add function to query pool capacity.
Diffstat (limited to 'mempool/src/mempool.c')
-rw-r--r-- | mempool/src/mempool.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mempool/src/mempool.c b/mempool/src/mempool.c index fdb5f8c..679f124 100644 --- a/mempool/src/mempool.c +++ b/mempool/src/mempool.c | |||
@@ -124,3 +124,8 @@ size_t mempool_get_block_index_(const mempool* pool, const void* block) { | |||
124 | assert(block_byte_index % pool->block_size_bytes == 0); | 124 | assert(block_byte_index % pool->block_size_bytes == 0); |
125 | return block_byte_index / pool->block_size_bytes; | 125 | return block_byte_index / pool->block_size_bytes; |
126 | } | 126 | } |
127 | |||
128 | size_t mempool_capacity_(const mempool* pool) { | ||
129 | assert(pool); | ||
130 | return pool->num_blocks * pool->block_size_bytes; | ||
131 | } | ||