- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/util/SmallObjectAllocator.cc
r7401 r11054 45 45 this->chunkSize_ = std::max(objectSize, sizeof(Chunk)); // the chunk's size will be the maximum of the object's size and the size of a Chunk object itself 46 46 this->numChunksPerBlock_ = numObjects; 47 this->first_ = 0;47 this->first_ = nullptr; 48 48 } 49 49 … … 53 53 SmallObjectAllocator::~SmallObjectAllocator() 54 54 { 55 for ( std::vector<char*>::iterator it = this->blocks_.begin(); it != this->blocks_.end(); ++it)56 delete[] *it;55 for (char* block : this->blocks_) 56 delete[] block; 57 57 } 58 58 … … 97 97 setNext(block + i * this->chunkSize_, block + (i + 1) * this->chunkSize_); 98 98 99 // the next_ pointer of the last chunk must point to NULL100 setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, 0);99 // the next_ pointer of the last chunk must point to nullptr 100 setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, nullptr); 101 101 102 102 // The second chunk in the block is assigned to the first_ pointer
Note: See TracChangeset
for help on using the changeset viewer.