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

Unified Diff: runtime/vm/zone.cc

Issue 1377663002: Add Timeline to dart:developer (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/zone.h ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone.cc
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index ea42f49055c2d6ce6d447feff7ec3b315a334cc7..7cb7977944dcbbc78dedecf334b15f109fe9c5bb 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -178,6 +178,21 @@ char* Zone::MakeCopyOfString(const char* str) {
}
+char* Zone::ConcatStrings(const char* a, const char* b, char join) {
+ intptr_t a_len = (a == NULL) ? 0 : strlen(a);
+ const intptr_t b_len = strlen(b) + 1; // '\0'-terminated.
+ const intptr_t len = a_len + b_len;
+ char* copy = Alloc<char>(len);
+ if (a_len > 0) {
+ strncpy(copy, a, a_len);
+ // Insert join character.
+ copy[a_len++] = join;
+ }
+ strncpy(&copy[a_len], b, b_len);
+ return copy;
+}
+
+
#if defined(DEBUG)
void Zone::DumpZoneSizes() {
intptr_t size = 0;
« no previous file with comments | « runtime/vm/zone.h ('k') | sdk/lib/_internal/js_runtime/lib/developer_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698