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

Unified Diff: runtime/vm/object.cc

Issue 9691005: Implement spawnFunction from the new isolate api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 5367)
+++ runtime/vm/object.cc (working copy)
@@ -7397,6 +7397,23 @@
}
+RawString* String::NewFormatted(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ intptr_t len = OS::VSNPrint(NULL, 0, format, args);
+ va_end(args);
+
+ Zone* zone = Isolate::Current()->current_zone();
+ char* buffer = reinterpret_cast<char*>(zone->Allocate(len + 1));
+ va_list args2;
+ va_start(args2, format);
+ OS::VSNPrint(buffer, (len + 1), format, args2);
+ va_end(args2);
+
+ return String::New(buffer);
+}
+
+
RawString* String::Concat(const String& str1,
const String& str2,
Heap::Space space) {

Powered by Google App Engine
This is Rietveld 408576698