X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Feltpool.h;h=7e295fb7b0d4bbaa71acb90f42fc4b386a4993cc;hb=c4bf633211b0424492b5a3937d6a6d2e0d79a4cf;hp=a682405cf1726c4bcea9d6ec278bc7c42f4c6de7;hpb=8d90ee5fdba7ae0543045753028887945c4cdf5d;p=libucw.git diff --git a/lib/eltpool.h b/lib/eltpool.h index a682405c..7e295fb7 100644 --- a/lib/eltpool.h +++ b/lib/eltpool.h @@ -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);