diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:08:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:08:42 +0200 |
commit | c32707148292d104c66276b43796d6057c8c7a5d (patch) | |
tree | bb83513f4aff24153e21a4ec92e34e4c27651b1f /shared/loki | |
parent | 3.9 (diff) | |
download | FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.gz FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.bz2 FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.zip |
3.10
Diffstat (limited to 'shared/loki')
-rw-r--r-- | shared/loki/SmallObj.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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 <loki/SmallObj.h> +#include "SmallObj.h" #include <cassert> #include <climits> @@ -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 |