X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fpool_alloc_mixin.cti;h=93b062ffd4fdd82dd08877d7021d9626c584d625;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=6d66abc1f2847026c07b42517cd1d5eb49035673;hpb=a1a6c76a214ad1935032826713cabaf9ac57bf07;p=senf.git diff --git a/Utils/pool_alloc_mixin.cti b/Utils/pool_alloc_mixin.cti index 6d66abc..93b062f 100644 --- a/Utils/pool_alloc_mixin.cti +++ b/Utils/pool_alloc_mixin.cti @@ -26,7 +26,7 @@ //#include "pool_alloc_mixin.ih" // Custom includes -#include <../Utils/senfassert.hh> +#include "../Utils/senfassert.hh" #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// @@ -36,8 +36,10 @@ prefix_ void * senf::pool_alloc_mixin::operator new(size_t size) { // When deriving from Self you may not change the class's size without // inheriting from pool_alloc_mixin again. See pool_alloc_mixin documentation. - SENF_ASSERT( size <= sizeof(Self) ); -#ifndef SENF_NO_DEBUG + SENF_ASSERT( size <= sizeof(Self) && + "senf::pool_alloc_mixin::operator new(): " + "Bad object size. Missing pool_alloc_mixin base in derived class?" ); +#ifdef SENF_DEBUG allocCounter(1); #endif return boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::malloc(); @@ -46,13 +48,13 @@ prefix_ void * senf::pool_alloc_mixin::operator new(size_t size) template prefix_ void senf::pool_alloc_mixin::operator delete(void * p, size_t size) { -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG allocCounter(-1); #endif boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::free(p); } -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG template prefix_ unsigned long senf::pool_alloc_mixin::allocCounter()