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

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

Issue 2621163008: VM: Free [TimelineEventBlock]s before shutting down (Closed)
Patch Set: Created 3 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
« no previous file with comments | « runtime/vm/timeline.h ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 #ifndef PRODUCT 5 #ifndef PRODUCT
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <cstdlib> 9 #include <cstdlib>
10 10
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 1498
1499 void TimelineEventCallbackRecorder::CompleteEvent(TimelineEvent* event) { 1499 void TimelineEventCallbackRecorder::CompleteEvent(TimelineEvent* event) {
1500 OnEvent(event); 1500 OnEvent(event);
1501 delete event; 1501 delete event;
1502 } 1502 }
1503 1503
1504 1504
1505 TimelineEventEndlessRecorder::TimelineEventEndlessRecorder() 1505 TimelineEventEndlessRecorder::TimelineEventEndlessRecorder()
1506 : head_(NULL), block_index_(0) {} 1506 : head_(NULL), block_index_(0) {}
1507 1507
1508 TimelineEventEndlessRecorder::~TimelineEventEndlessRecorder() {
1509 TimelineEventBlock* current = head_;
1510 head_ = NULL;
1511
1512 while (current != NULL) {
1513 TimelineEventBlock* next = current->next();
1514 delete current;
1515 current = next;
1516 }
1517 }
1508 1518
1509 void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js, 1519 void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js,
1510 TimelineEventFilter* filter) { 1520 TimelineEventFilter* filter) {
1511 if (!FLAG_support_service) { 1521 if (!FLAG_support_service) {
1512 return; 1522 return;
1513 } 1523 }
1514 JSONObject topLevel(js); 1524 JSONObject topLevel(js);
1515 topLevel.AddProperty("type", "_Timeline"); 1525 topLevel.AddProperty("type", "_Timeline");
1516 { 1526 {
1517 JSONArray events(&topLevel, "traceEvents"); 1527 JSONArray events(&topLevel, "traceEvents");
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 TimelineEventBlock* TimelineEventBlockIterator::Next() { 1774 TimelineEventBlock* TimelineEventBlockIterator::Next() {
1765 ASSERT(current_ != NULL); 1775 ASSERT(current_ != NULL);
1766 TimelineEventBlock* r = current_; 1776 TimelineEventBlock* r = current_;
1767 current_ = current_->next(); 1777 current_ = current_->next();
1768 return r; 1778 return r;
1769 } 1779 }
1770 1780
1771 } // namespace dart 1781 } // namespace dart
1772 1782
1773 #endif // !PRODUCT 1783 #endif // !PRODUCT
OLDNEW
« no previous file with comments | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698