remove warnings when NDEBUG is defined

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@384 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2005-12-19 08:05:46 +00:00
parent bf9071ebdb
commit 4bdb1d4532

View file

@ -487,7 +487,8 @@ bool Chunk::IsCorrupt( unsigned char numBlocks, std::size_t blockSize,
bool Chunk::IsBlockAvailable( void * p, unsigned char numBlocks, bool Chunk::IsBlockAvailable( void * p, unsigned char numBlocks,
std::size_t blockSize ) const std::size_t blockSize ) const
{ {
(void) numBlocks;
if ( IsFilled() ) if ( IsFilled() )
return false; return false;
@ -1061,6 +1062,7 @@ void * SmallObjAllocator::Allocate( std::size_t numBytes, bool doThrow )
if ( 0 == numBytes ) numBytes = 1; if ( 0 == numBytes ) numBytes = 1;
const std::size_t index = GetOffset( numBytes, GetAlignment() ) - 1; const std::size_t index = GetOffset( numBytes, GetAlignment() ) - 1;
const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() ); const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() );
(void) allocCount;
assert( index < allocCount ); assert( index < allocCount );
FixedAllocator & allocator = pool_[ index ]; FixedAllocator & allocator = pool_[ index ];
@ -1098,11 +1100,13 @@ void SmallObjAllocator::Deallocate( void * p, std::size_t numBytes )
if ( 0 == numBytes ) numBytes = 1; if ( 0 == numBytes ) numBytes = 1;
const std::size_t index = GetOffset( numBytes, GetAlignment() ) - 1; const std::size_t index = GetOffset( numBytes, GetAlignment() ) - 1;
const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() ); const std::size_t allocCount = GetOffset( GetMaxObjectSize(), GetAlignment() );
(void) allocCount;
assert( index < allocCount ); assert( index < allocCount );
FixedAllocator & allocator = pool_[ index ]; FixedAllocator & allocator = pool_[ index ];
assert( allocator.BlockSize() >= numBytes ); assert( allocator.BlockSize() >= numBytes );
assert( allocator.BlockSize() < numBytes + GetAlignment() ); assert( allocator.BlockSize() < numBytes + GetAlignment() );
const bool found = allocator.Deallocate( p, NULL ); const bool found = allocator.Deallocate( p, NULL );
(void) found;
assert( found ); assert( found );
} }
@ -1133,6 +1137,7 @@ void SmallObjAllocator::Deallocate( void * p )
assert( NULL != chunk ); assert( NULL != chunk );
const bool found = pAllocator->Deallocate( p, chunk ); const bool found = pAllocator->Deallocate( p, chunk );
(void) found;
assert( found ); assert( found );
} }
@ -1177,6 +1182,9 @@ bool SmallObjAllocator::IsCorrupt( void ) const
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Log$ // $Log$
// Revision 1.19 2005/12/19 08:05:46 syntheticpp
// remove warnings when NDEBUG is defined
//
// Revision 1.18 2005/12/08 22:08:20 rich_sposato // Revision 1.18 2005/12/08 22:08:20 rich_sposato
// Added functions to check for corrupted Chunks and FixedAllocators. Made // Added functions to check for corrupted Chunks and FixedAllocators. Made
// several minor coding changes. // several minor coding changes.