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

Unified Diff: runtime/vm/disassembler_x64.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/disassembler_ia32.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_x64.cc
diff --git a/runtime/vm/disassembler_x64.cc b/runtime/vm/disassembler_x64.cc
index 9f43a387ba81ce8d31f8280e3867d6eeec7713f4..ffd610823ec0fc88008c59534efa829a436ec04c 100644
--- a/runtime/vm/disassembler_x64.cc
+++ b/runtime/vm/disassembler_x64.cc
@@ -796,11 +796,8 @@ static const char* ObjectToCStringNoGC(const Object& obj) {
const Class& clazz = Class::Handle(obj.clazz());
const char* full_class_name = clazz.ToCString();
- const char* format = "instance of %s";
- intptr_t len = OS::SNPrint(NULL, 0, format, full_class_name) + 1;
- char* chars = Thread::Current()->zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, format, full_class_name);
- return chars;
+ return OS::SCreate(Thread::Current()->zone(),
+ "instance of %s", full_class_name);
}
« no previous file with comments | « runtime/vm/disassembler_ia32.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698