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

Side by Side Diff: runtime/vm/isolate.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: Format string fixes 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 void Isolate::BuildName(const char* name_prefix) { 893 void Isolate::BuildName(const char* name_prefix) {
894 ASSERT(name_ == NULL); 894 ASSERT(name_ == NULL);
895 if (name_prefix == NULL) { 895 if (name_prefix == NULL) {
896 name_prefix = "isolate"; 896 name_prefix = "isolate";
897 } 897 }
898 set_debugger_name(name_prefix); 898 set_debugger_name(name_prefix);
899 if (ServiceIsolate::NameEquals(name_prefix)) { 899 if (ServiceIsolate::NameEquals(name_prefix)) {
900 name_ = strdup(name_prefix); 900 name_ = strdup(name_prefix);
901 return; 901 return;
902 } 902 }
903 const char* kFormat = "%s-%lld"; 903 SNPRINT(name_, malloc, "%s-%" Pd64 "", name_prefix, main_port());
904 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name_prefix, main_port()) + 1;
905 name_ = reinterpret_cast<char*>(malloc(len));
906 OS::SNPrint(name_, len, kFormat, name_prefix, main_port());
907 } 904 }
908 905
909 906
910 Log* Isolate::Log() const { 907 Log* Isolate::Log() const {
911 if (FLAG_isolate_log_filter == NULL) { 908 if (FLAG_isolate_log_filter == NULL) {
912 if (is_service_isolate_) { 909 if (is_service_isolate_) {
913 // By default, do not log for the service isolate. 910 // By default, do not log for the service isolate.
914 return Log::NoOpLog(); 911 return Log::NoOpLog();
915 } 912 }
916 return log_; 913 return log_;
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2353 serialized_message_, serialized_message_len_); 2350 serialized_message_, serialized_message_len_);
2354 } 2351 }
2355 2352
2356 2353
2357 void IsolateSpawnState::Cleanup() { 2354 void IsolateSpawnState::Cleanup() {
2358 SwitchIsolateScope switch_scope(I); 2355 SwitchIsolateScope switch_scope(I);
2359 Dart::ShutdownIsolate(); 2356 Dart::ShutdownIsolate();
2360 } 2357 }
2361 2358
2362 } // namespace dart 2359 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/disassembler_x64.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698