Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: src/zone.cc

Issue 13210: - Simplify the code slightly by using Max(). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone.cc
===================================================================
--- src/zone.cc (revision 926)
+++ src/zone.cc (working copy)
@@ -169,16 +169,10 @@
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");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698