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

Unified Diff: runtime/vm/timeline.cc

Issue 1331623002: Uses SNPRINT macro where possible. Otherwise uses #define for format. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add missing include Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stack_frame_test.cc ('k') | runtime/vm/version_in.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline.cc
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index ac5545196e85a39d0a945077dc5da75d88596c5b..d510d5ee984e5f61673bd27581f87196244e130f 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -452,11 +452,9 @@ void TimelineEventRecorder::WriteTo(const char* directory) {
TimelineEventFilter filter;
PrintJSON(&js, &filter);
- const char* format = "%s/dart-timeline-%" Pd ".json";
intptr_t pid = OS::ProcessId();
- intptr_t len = OS::SNPrint(NULL, 0, format, directory, pid);
- char* filename = reinterpret_cast<char*>(malloc(len + 1));
- OS::SNPrint(filename, len + 1, format, directory, pid);
+ char* filename = OS::SCreate(NULL,
+ "%s/dart-timeline-%" Pd ".json", directory, pid);
void* file = (*file_open)(filename, true);
if (file == NULL) {
OS::Print("Failed to write timeline file: %s\n", filename);
« no previous file with comments | « runtime/vm/stack_frame_test.cc ('k') | runtime/vm/version_in.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698