X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fpool_alloc_mixin.cti;h=2e78ad277a987db3ff1c2a192dffe5155f0dea75;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=a16314638c66e80dfcd8358aaf895a5f084f8abe;hpb=f13c1275e48e97dceb7de7925793a4c69a5aeb61;p=senf.git diff --git a/Utils/pool_alloc_mixin.cti b/Utils/pool_alloc_mixin.cti index a163146..2e78ad2 100644 --- a/Utils/pool_alloc_mixin.cti +++ b/Utils/pool_alloc_mixin.cti @@ -1,6 +1,8 @@ +// $Id$ +// // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -24,7 +26,7 @@ //#include "pool_alloc_mixin.ih" // Custom includes -#include +#include <../Utils/senfassert.hh> #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// @@ -34,8 +36,8 @@ 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. - BOOST_ASSERT( size == sizeof(Self) ); -#ifndef NDEBUG + SENF_ASSERT( size <= sizeof(Self) ); +#ifndef SENF_NO_DEBUG allocCounter(1); #endif return boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::malloc(); @@ -44,16 +46,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) { - // When deriving from Self you may not change the class's size without - // inheriting from pool_alloc_mixin again. See pool_alloc_mixin documentation. - BOOST_ASSERT( size == sizeof(Self) ); -#ifndef NDEBUG +#ifndef SENF_NO_DEBUG allocCounter(-1); #endif boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::free(p); } -#ifndef NDEBUG +#ifndef SENF_NO_DEBUG template prefix_ unsigned long senf::pool_alloc_mixin::allocCounter()