From f84700a1828141d3edd98b7d6de3fe30781ad256 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 10 Mar 2011 14:49:01 +0000 Subject: [PATCH] Keep pool name also for pool-fast It's cheap to keep this name - and it is useful for 'non pool debug code' compilation. --- libdm/mm/pool-fast.c | 2 ++ libdm/mm/pool.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libdm/mm/pool-fast.c b/libdm/mm/pool-fast.c index ebd982e6d..377ad99ca 100644 --- a/libdm/mm/pool-fast.c +++ b/libdm/mm/pool-fast.c @@ -28,6 +28,7 @@ struct dm_pool { struct dm_list list; struct chunk *chunk, *spare_chunk; /* spare_chunk is a one entry free list to stop 'bobbling' */ + const char *name; size_t chunk_size; size_t object_len; unsigned object_alignment; @@ -51,6 +52,7 @@ struct dm_pool *dm_pool_create(const char *name, size_t chunk_hint) return 0; } + p->name = name; /* round chunk_hint up to the next power of 2 */ p->chunk_size = chunk_hint + sizeof(struct chunk); while (new_size < p->chunk_size) diff --git a/libdm/mm/pool.c b/libdm/mm/pool.c index 35bfffae4..825f7cad8 100644 --- a/libdm/mm/pool.c +++ b/libdm/mm/pool.c @@ -71,7 +71,7 @@ void dm_pools_check_leaks(void) p->orig_pool, p->name, p->stats.bytes); #else - log_error(" [%p]", p); + log_error(" [%p] %s", p, p->name); #endif } } -- 2.43.5