]> mj.ucw.cz Git - libucw.git/blobdiff - lib/eltpool.h
bgetl() should return uns instead of u32
[libucw.git] / lib / eltpool.h
index a682405cf1726c4bcea9d6ec278bc7c42f4c6de7..7e295fb7b0d4bbaa71acb90f42fc4b386a4993cc 100644 (file)
@@ -16,6 +16,7 @@ struct eltpool {
   uns elt_size;
   uns chunk_size;
   uns elts_per_chunk;
+  uns num_allocated;           // Just for debugging
 };
 
 struct eltpool_chunk {
@@ -34,6 +35,7 @@ void *ep_alloc_slow(struct eltpool *pool);
 static inline void *
 ep_alloc(struct eltpool *pool)
 {
+  pool->num_allocated++;
 #ifdef CONFIG_FAKE_ELTPOOL
   return xmalloc(pool->elt_size);
 #else
@@ -49,6 +51,7 @@ ep_alloc(struct eltpool *pool)
 static inline void
 ep_free(struct eltpool *pool, void *p)
 {
+  pool->num_allocated--;
 #ifdef CONFIG_FAKE_ELTPOOL
   (void) pool;
   xfree(p);