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

Unified Diff: runtime/vm/disassembler_ia32.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/debugger.cc ('k') | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_ia32.cc
diff --git a/runtime/vm/disassembler_ia32.cc b/runtime/vm/disassembler_ia32.cc
index b18dd3ff03e9bb90cda636d96864b4a5d3af4bc3..036f5d0aa9dae6708f7f137f79d07b2f774699de 100644
--- a/runtime/vm/disassembler_ia32.cc
+++ b/runtime/vm/disassembler_ia32.cc
@@ -479,11 +479,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/debugger.cc ('k') | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698