Moved emptyChunk_ assignment because code depends upon it. And added if

statement before line where allocChunk_ is assigned.


git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@296 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2005-10-13 22:41:05 +00:00
parent 01349cc358
commit a810fb8d0f

View file

@ -414,9 +414,7 @@ bool FixedAllocator::TrimEmptyChunk( void )
assert( lastChunk->HasAvailable( numBlocks_ ) );
lastChunk->Release();
chunks_.pop_back();
emptyChunk_ = NULL;
assert( 0 == CountEmptyChunks() );
if ( chunks_.empty() )
{
allocChunk_ = NULL;
@ -436,6 +434,9 @@ bool FixedAllocator::TrimEmptyChunk( void )
}
}
emptyChunk_ = NULL;
assert( 0 == CountEmptyChunks() );
return true;
}
@ -622,6 +623,7 @@ void FixedAllocator::DoDeallocate(void* p)
assert( lastChunk->HasAvailable( numBlocks_ ) );
lastChunk->Release();
chunks_.pop_back();
if ( allocChunk_->IsFilled() )
allocChunk_ = deallocChunk_;
}
emptyChunk_ = deallocChunk_;
@ -811,6 +813,10 @@ void SmallObjAllocator::Deallocate( void * p )
////////////////////////////////////////////////////////////////////////////////
// $Log$
// Revision 1.8 2005/10/13 22:41:05 rich_sposato
// Moved emptyChunk_ assignment because code depends upon it. And added if
// statement before line where allocChunk_ is assigned.
//
// Revision 1.7 2005/09/27 00:40:30 rich_sposato
// Moved Chunk out of FixedAllocator class so I could improve efficiency for
// SmallObjAllocator::Deallocate.