]> mj.ucw.cz Git - libucw.git/blobdiff - lib/eltpool.c
Implemented {mp,ep}_total_size().
[libucw.git] / lib / eltpool.c
index f82de845e56b925a0c27301e504350313b0d9053..b32843fc6ed360638094346db600c2aaba722867 100644 (file)
@@ -60,9 +60,16 @@ ep_alloc_slow(struct eltpool *pool)
     }
   ch->next = pool->first_chunk;
   pool->first_chunk = ch;
+  pool->num_chunks++;
   return p;
 }
 
+u64
+ep_total_size(struct eltpool *pool)
+{
+  return (u64)pool->num_chunks * pool->chunk_size + sizeof(*pool);
+}
+
 #ifdef TEST
 
 #include <stdio.h>