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. --- mem/src/mem.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mem/src/mem.c') diff --git a/mem/src/mem.c b/mem/src/mem.c index ff97f0f..056d947 100644 --- a/mem/src/mem.c +++ b/mem/src/mem.c @@ -181,3 +181,8 @@ size_t mem_get_chunk_handle_(const Memory* mem, const void* chunk) { assert(block_byte_index % mem->block_size_bytes == 0); return block_byte_index / mem->block_size_bytes; } + +size_t mem_capacity_(const Memory* mem) { + assert(mem); + return mem->num_blocks * mem->block_size_bytes; +} -- cgit v1.2.3