From: iposva@chromium.org Date: Fri, 5 Dec 2008 21:51:46 +0000 (+0000) Subject: - Simplify the code slightly by using Max(). X-Git-Tag: upstream/4.7.83~24898 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72c07041a820e74fdb0e0927d99ebdc4d10ce8b1;p=platform%2Fupstream%2Fv8.git - Simplify the code slightly by using Max(). TBR=kasperl Review URL: http://codereview.chromium.org/13210 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@928 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/zone.cc b/src/zone.cc index 4eac3d3..c8f9c85 100644 --- a/src/zone.cc +++ b/src/zone.cc @@ -169,16 +169,10 @@ Address Zone::NewExpand(int size) { new_size = kMinimumSegmentSize; } 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; - } + // exponentially, thus putting pressure on contiguous virtual address space. + // All the while making sure to allocate a segment 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");