Commit 72c07041 authored by iposva@chromium.org's avatar iposva@chromium.org

- 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
parent f455d7af
...@@ -169,16 +169,10 @@ Address Zone::NewExpand(int size) { ...@@ -169,16 +169,10 @@ Address Zone::NewExpand(int size) {
new_size = kMinimumSegmentSize; new_size = kMinimumSegmentSize;
} else if (new_size > kMaximumSegmentSize) { } else if (new_size > kMaximumSegmentSize) {
// Limit the size of new segments to avoid growing the segment size // Limit the size of new segments to avoid growing the segment size
// exponentially, thus putting pressure on contiguous virtual address // exponentially, thus putting pressure on contiguous virtual address space.
// space. // All the while making sure to allocate a segment large enough to hold the
if (size > (kMaximumSegmentSize - kSegmentOverhead)) { // requested size.
// Make sure to allocate a segment at large enough to hold the requested new_size = Max(kSegmentOverhead + size, kMaximumSegmentSize);
// size.
new_size = kSegmentOverhead + size;
} else {
// Allocate a new segment of maximum size.
new_size = kMaximumSegmentSize;
}
} }
Segment* segment = Segment::New(new_size); Segment* segment = Segment::New(new_size);
if (segment == NULL) V8::FatalProcessOutOfMemory("Zone"); if (segment == NULL) V8::FatalProcessOutOfMemory("Zone");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment