Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r185663 - SegmentedVector should waste less memory.
<https://webkit.org/b/146069> Reviewed by Anders Carlsson. We were wasting sizeof(Vector) on every segment in SegmentVector. The segments were using inline capacity, and would never go beyond it, so all the size/capacity/out-of-line-buffer metadata was useless. Change the internal representation to Vector<T[SegmentSize]> instead. This saves 16 bytes per segment, so lower SegmentSize -> bigger savings! * wtf/SegmentedVector.h: (WTF::SegmentedVectorIterator::operator*): (WTF::SegmentedVectorIterator::operator->): (WTF::SegmentedVectorIterator::operator++): (WTF::SegmentedVectorIterator::operator==): (WTF::SegmentedVectorIterator::operator!=): (WTF::SegmentedVectorIterator::SegmentedVectorIterator): (WTF::SegmentedVector::at): (WTF::SegmentedVector::append): (WTF::SegmentedVector::removeLast): (WTF::SegmentedVector::grow): (WTF::SegmentedVector::begin): (WTF::SegmentedVector::end): (WTF::SegmentedVector::deleteAllSegments): (WTF::SegmentedVector::ensureSegmentsFor): (WTF::SegmentedVector::ensureSegment): (WTF::SegmentedVector::allocateSegment): (WTF::SegmentedVectorIterator::operator=): Deleted. (WTF::SegmentedVector::SegmentedVector): Deleted.
- Loading branch information
1 parent
733b409
commit 8e01153
Showing
2 changed files
with
68 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters