Reviewers: Kasper Lund, Description: - Simplify the code slightly by using Max().
TBR=kasperl Please review this at http://codereview.chromium.org/13210 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/zone.cc Index: src/zone.cc =================================================================== --- src/zone.cc (revision 926) +++ src/zone.cc (working copy) @@ -170,15 +170,9 @@ } else if (new_size > kMaximumSegmentSize) { // Limit the size of new segments to avoid growing the segment size // exponentially, thus putting pressure on contiguous virtual address - // space. - if (size > (kMaximumSegmentSize - kSegmentOverhead)) { - // Make sure to allocate a segment at large enough to hold the requested - // size. - new_size = kSegmentOverhead + size; - } else { - // Allocate a new segment of maximum size. - new_size = kMaximumSegmentSize; - } + // space. All the while making sure to allocate a segment at large enough + // to hold the requested size. + new_size = Max(kSegmentOverhead + size, kMaximumSegmentSize); } Segment* segment = Segment::New(new_size); if (segment == NULL) V8::FatalProcessOutOfMemory("Zone"); --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
