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

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

Issue 11428067: Merge the Merlin heap tracing to top-of-trunk. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/vm_sources.gypi ('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 (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/heap.h"
11 #include "vm/heap_trace.h"
10 #include "vm/isolate.h" 12 #include "vm/isolate.h"
11 #include "vm/os.h" 13 #include "vm/os.h"
12 14
13 namespace dart { 15 namespace dart {
14 16
15 DEFINE_DEBUG_FLAG(bool, trace_zone_sizes, 17 DEFINE_DEBUG_FLAG(bool, trace_zone_sizes,
16 false, "Traces allocation sizes in the zone."); 18 false, "Traces allocation sizes in the zone.");
17 19
18 20
19 // Zone segments represent chunks of memory: They have starting 21 // Zone segments represent chunks of memory: They have starting
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #ifdef DEBUG 86 #ifdef DEBUG
85 // Zap the entire initial buffer. 87 // Zap the entire initial buffer.
86 memset(initial_buffer_.pointer(), kZapUninitializedByte, 88 memset(initial_buffer_.pointer(), kZapUninitializedByte,
87 initial_buffer_.size()); 89 initial_buffer_.size());
88 #endif 90 #endif
89 } 91 }
90 92
91 93
92 Zone::~Zone() { 94 Zone::~Zone() {
93 DeleteAll(); 95 DeleteAll();
96 if (HeapTrace::is_enabled()) {
97 Isolate* isolate = Isolate::Current();
98 isolate->heap()->trace()->TraceDeleteZone(this);
99 }
94 #if defined(DEBUG) 100 #if defined(DEBUG)
95 if (FLAG_trace_zone_sizes) { 101 if (FLAG_trace_zone_sizes) {
96 DumpZoneSizes(); 102 DumpZoneSizes();
97 } 103 }
98 #endif 104 #endif
99 } 105 }
100 106
101 107
102 void Zone::DeleteAll() { 108 void Zone::DeleteAll() {
103 // Traverse the chained list of segments, zapping (in debug mode) 109 // Traverse the chained list of segments, zapping (in debug mode)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 va_list args2; 244 va_list args2;
239 va_start(args2, format); 245 va_start(args2, format);
240 OS::VSNPrint(buffer, (len + 1), format, args2); 246 OS::VSNPrint(buffer, (len + 1), format, args2);
241 va_end(args2); 247 va_end(args2);
242 248
243 return buffer; 249 return buffer;
244 } 250 }
245 251
246 252
247 } // namespace dart 253 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/vm_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698