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

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

Issue 2254543006: Reduce copying in sending service responses. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: dbc, sync Created 4 years, 4 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/service_test.cc ('k') | sdk/lib/vmservice/vmservice.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) 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 <cstdlib> 7 #include <cstdlib>
8 8
9 #include "vm/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 return; 1173 return;
1174 } 1174 }
1175 free(filename); 1175 free(filename);
1176 1176
1177 JSONStream js; 1177 JSONStream js;
1178 TimelineEventFilter filter; 1178 TimelineEventFilter filter;
1179 PrintTraceEvent(&js, &filter); 1179 PrintTraceEvent(&js, &filter);
1180 // Steal output from JSONStream. 1180 // Steal output from JSONStream.
1181 char* output = NULL; 1181 char* output = NULL;
1182 intptr_t output_length = 0; 1182 intptr_t output_length = 0;
1183 js.Steal(const_cast<const char**>(&output), &output_length); 1183 js.Steal(&output, &output_length);
1184 (*file_write)(output, output_length, file); 1184 (*file_write)(output, output_length, file);
1185 // Free the stolen output. 1185 // Free the stolen output.
1186 free(output); 1186 free(output);
1187 (*file_close)(file); 1187 (*file_close)(file);
1188 1188
1189 return; 1189 return;
1190 } 1190 }
1191 1191
1192 1192
1193 int64_t TimelineEventRecorder::GetNextAsyncId() { 1193 int64_t TimelineEventRecorder::GetNextAsyncId() {
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 TimelineEventBlock* TimelineEventBlockIterator::Next() { 1688 TimelineEventBlock* TimelineEventBlockIterator::Next() {
1689 ASSERT(current_ != NULL); 1689 ASSERT(current_ != NULL);
1690 TimelineEventBlock* r = current_; 1690 TimelineEventBlock* r = current_;
1691 current_ = current_->next(); 1691 current_ = current_->next();
1692 return r; 1692 return r;
1693 } 1693 }
1694 1694
1695 } // namespace dart 1695 } // namespace dart
1696 1696
1697 #endif // !PRODUCT 1697 #endif // !PRODUCT
OLDNEW
« no previous file with comments | « runtime/vm/service_test.cc ('k') | sdk/lib/vmservice/vmservice.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698