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

Side by Side Diff: dart/runtime/vm/zone.cc

Issue 849893002: Version 1.8.5 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.8/
Patch Set: Created 5 years, 11 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 | « dart/runtime/vm/zone.h ('k') | dart/tests/language/regress_21795_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/zone.h" 5 #include "vm/zone.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/handles_impl.h" 10 #include "vm/handles_impl.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #endif 56 #endif
57 Segment::Delete(current); 57 Segment::Delete(current);
58 current = next; 58 current = next;
59 } 59 }
60 } 60 }
61 61
62 62
63 Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) { 63 Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
64 ASSERT(size >= 0); 64 ASSERT(size >= 0);
65 Segment* result = reinterpret_cast<Segment*>(new uint8_t[size]); 65 Segment* result = reinterpret_cast<Segment*>(new uint8_t[size]);
66 ASSERT(Utils::IsAligned(result->start(), Zone::kAlignment));
66 if (result != NULL) { 67 if (result != NULL) {
67 #ifdef DEBUG 68 #ifdef DEBUG
68 // Zap the entire allocated segment (including the header). 69 // Zap the entire allocated segment (including the header).
69 memset(result, kZapUninitializedByte, size); 70 memset(result, kZapUninitializedByte, size);
70 #endif 71 #endif
71 result->next_ = next; 72 result->next_ = next;
72 result->size_ = size; 73 result->size_ = size;
73 } 74 }
74 return result; 75 return result;
75 } 76 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 va_list args2; 210 va_list args2;
210 va_start(args2, format); 211 va_start(args2, format);
211 OS::VSNPrint(buffer, (len + 1), format, args2); 212 OS::VSNPrint(buffer, (len + 1), format, args2);
212 va_end(args2); 213 va_end(args2);
213 214
214 return buffer; 215 return buffer;
215 } 216 }
216 217
217 218
218 } // namespace dart 219 } // namespace dart
OLDNEW
« no previous file with comments | « dart/runtime/vm/zone.h ('k') | dart/tests/language/regress_21795_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698