From c32707148292d104c66276b43796d6057c8c7a5d Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:08:42 +0200 Subject: 3.10 --- shared/loki/SmallObj.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'shared/loki') diff --git a/shared/loki/SmallObj.cpp b/shared/loki/SmallObj.cpp index a2911bb1..adb54c55 100644 --- a/shared/loki/SmallObj.cpp +++ b/shared/loki/SmallObj.cpp @@ -2,21 +2,21 @@ // The Loki Library // Copyright (c) 2001 by Andrei Alexandrescu // This code accompanies the book: -// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design +// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design // Patterns Applied". Copyright (c) 2001. Addison-Wesley. -// Permission to use, copy, modify, distribute and sell this software for any -// purpose is hereby granted without fee, provided that the above copyright -// notice appear in all copies and that both that copyright notice and this +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this // permission notice appear in supporting documentation. -// The author or Addison-Wesley Longman make no representations about the -// suitability of this software for any purpose. It is provided "as is" +// The author or Addison-Wesley Longman make no representations about the +// suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// // $Id: SmallObj.cpp 823 2007-05-08 10:48:40Z lfittl $ -#include +#include "SmallObj.h" #include #include @@ -359,7 +359,7 @@ void* Chunk::Allocate(std::size_t blockSize) { if ( IsFilled() ) return NULL; - assert((firstAvailableBlock_ * blockSize) / blockSize == + assert((firstAvailableBlock_ * blockSize) / blockSize == firstAvailableBlock_); unsigned char * pResult = pData_ + (firstAvailableBlock_ * blockSize); firstAvailableBlock_ = *pResult; @@ -503,7 +503,7 @@ bool Chunk::IsBlockAvailable( void * p, unsigned char numBlocks, std::size_t blockSize ) const { (void) numBlocks; - + if ( IsFilled() ) return false; @@ -860,8 +860,8 @@ void * FixedAllocator::Allocate( void ) } } else if ( allocChunk_ == emptyChunk_) - // detach emptyChunk_ from allocChunk_, because after - // calling allocChunk_->Allocate(blockSize_); the chunk + // detach emptyChunk_ from allocChunk_, because after + // calling allocChunk_->Allocate(blockSize_); the chunk // is no longer empty. emptyChunk_ = NULL; @@ -997,7 +997,7 @@ void FixedAllocator::DoDeallocate(void* p) assert( lastChunk->HasAvailable( numBlocks_ ) ); lastChunk->Release(); chunks_.pop_back(); - if ( ( allocChunk_ == lastChunk ) || allocChunk_->IsFilled() ) + if ( ( allocChunk_ == lastChunk ) || allocChunk_->IsFilled() ) allocChunk_ = deallocChunk_; } emptyChunk_ = deallocChunk_; @@ -1040,7 +1040,7 @@ void * DefaultAllocator( std::size_t numBytes, bool doThrow ) // DefaultDeallocator --------------------------------------------------------- /** @ingroup SmallObjectGroupInternal - Calls default deallocator when SmallObjAllocator decides not to handle a + Calls default deallocator when SmallObjAllocator decides not to handle a request. The default deallocator could be the global delete operator or the free function. The free function is the preferred default deallocator since it matches malloc which is the preferred default allocator. SmallObjAllocator -- cgit