diff --git a/lib/mm/pool-debug.c b/lib/mm/pool-debug.c index 6c1978a2c..d7530e5cc 100644 --- a/lib/mm/pool-debug.c +++ b/lib/mm/pool-debug.c @@ -32,7 +32,8 @@ struct pool *pool_create(size_t chunk_hint) struct pool *mem = dbg_malloc(sizeof(*mem)); if (!mem) { - stack; + log_error("Couldn't create memory pool (size %u)", + sizeof(*mem)); return NULL; } @@ -79,7 +80,7 @@ static struct block *_new_block(size_t s, unsigned alignment) struct block *b = dbg_malloc(len); if (!b) { - log_err("Out of memory."); + log_err("Out of memory. Requested %u bytes.", len); return NULL; } diff --git a/lib/mm/pool-fast.c b/lib/mm/pool-fast.c index 7f2bc8907..4698de473 100644 --- a/lib/mm/pool-fast.c +++ b/lib/mm/pool-fast.c @@ -36,7 +36,8 @@ struct pool *pool_create(size_t chunk_hint) struct pool *p = dbg_malloc(sizeof(*p)); if (!p) { - log_error("Couldn't create memory pool"); + log_error("Couldn't create memory pool (size %u)", + sizeof(*p)); return 0; } memset(p, 0, sizeof(*p)); @@ -223,7 +224,7 @@ struct chunk *_new_chunk(struct pool *p, size_t s) p->spare_chunk = 0; } else { if (!(c = dbg_malloc(s))) { - log_err("Out of memory."); + log_err("Out of memory. Requested %u bytes.", s); return NULL; }