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

Side by Side Diff: src/zone.cc

Issue 159192: Fix some defects identifies by Coverity Prevent. All are false... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (new_size < kMinimumSegmentSize) { 169 if (new_size < kMinimumSegmentSize) {
170 new_size = kMinimumSegmentSize; 170 new_size = kMinimumSegmentSize;
171 } else if (new_size > kMaximumSegmentSize) { 171 } else if (new_size > kMaximumSegmentSize) {
172 // Limit the size of new segments to avoid growing the segment size 172 // Limit the size of new segments to avoid growing the segment size
173 // exponentially, thus putting pressure on contiguous virtual address space. 173 // exponentially, thus putting pressure on contiguous virtual address space.
174 // All the while making sure to allocate a segment large enough to hold the 174 // All the while making sure to allocate a segment large enough to hold the
175 // requested size. 175 // requested size.
176 new_size = Max(kSegmentOverhead + size, kMaximumSegmentSize); 176 new_size = Max(kSegmentOverhead + size, kMaximumSegmentSize);
177 } 177 }
178 Segment* segment = Segment::New(new_size); 178 Segment* segment = Segment::New(new_size);
179 if (segment == NULL) V8::FatalProcessOutOfMemory("Zone"); 179 if (segment == NULL) {
180 V8::FatalProcessOutOfMemory("Zone");
181 return NULL;
182 }
180 183
181 // Recompute 'top' and 'limit' based on the new segment. 184 // Recompute 'top' and 'limit' based on the new segment.
182 Address result = RoundUp(segment->start(), kAlignment); 185 Address result = RoundUp(segment->start(), kAlignment);
183 position_ = result + size; 186 position_ = result + size;
184 limit_ = segment->end(); 187 limit_ = segment->end();
185 ASSERT(position_ <= limit_); 188 ASSERT(position_ <= limit_);
186 return result; 189 return result;
187 } 190 }
188 191
189 192
190 } } // namespace v8::internal 193 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698