From a703e2ff58c82696cb46a48bb28cdb557d1dc0bc Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 21 Mar 2016 18:22:52 +0000 Subject: [PATCH] Increase verbosity of Pool assertion failure messages. --- src/core/pool_type.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 4d20ed1abb..b73323c831 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -110,7 +110,7 @@ struct Pool : PoolBase { */ inline Titem *Get(size_t index) { - assert(index < this->first_unused); + assert_msg(index < this->first_unused, "index: %zu, first_unused: %zu, name: %s", index, this->first_unused, this->name); return this->data[index]; } @@ -166,7 +166,7 @@ struct Pool : PoolBase { { if (p == NULL) return; Titem *pn = (Titem *)p; - assert(pn == Tpool->Get(pn->index)); + assert_msg(pn == Tpool->Get(pn->index), "name: %s", Tpool->name); Tpool->FreeItem(pn->index); } @@ -200,7 +200,7 @@ struct Pool : PoolBase { * memory are the same (because of possible inheritance). * Use { size_t index = item->index; delete item; new (index) item; } * instead to make sure destructor is called and no memory leaks. */ - assert(ptr != Tpool->data[i]); + assert_msg(ptr != Tpool->data[i], "name: %s", Tpool->name); } return ptr; }