From ecc2645ba4c44005ef13e33c79059de69b76551f Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 16 Jul 2023 16:31:59 -0700 Subject: Add function to query pool capacity. --- mempool/src/mempool.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mempool/src/mempool.c') 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) { assert(block_byte_index % pool->block_size_bytes == 0); return block_byte_index / pool->block_size_bytes; } + +size_t mempool_capacity_(const mempool* pool) { + assert(pool); + return pool->num_blocks * pool->block_size_bytes; +} -- cgit v1.2.3