Bug 1216970 - Make the copying more obvious in ProfilerImpl::GetStacktrace. r=froydnj
authorKan-Ru Chen <kanru@kanru.info>
Fri, 23 Oct 2015 11:42:32 +0800
changeset 269146 abaedc34e7e91a204abccf4d6578e7d5ebf430d6
parent 269145 9e015ac7d76e095581c7fe0edb0157eae0305c9b
child 269147 34f53b05a578fa60e13ea6c117bc48f1413df3aa
push id67014
push userkchen@mozilla.com
push dateFri, 23 Oct 2015 03:43:29 +0000
treeherdermozilla-inbound@abaedc34e7e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1216970
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1216970 - Make the copying more obvious in ProfilerImpl::GetStacktrace. r=froydnj
tools/memory-profiler/MemoryProfiler.cpp
--- a/tools/memory-profiler/MemoryProfiler.cpp
+++ b/tools/memory-profiler/MemoryProfiler.cpp
@@ -41,17 +41,17 @@ ProfilerImpl::ProfilerImpl()
 nsTArray<nsCString>
 ProfilerImpl::GetStacktrace()
 {
   nsTArray<nsCString> trace;
   nsAutoArrayPtr<char> output(new char[BACKTRACE_BUFFER_SIZE]);
 
   profiler_get_backtrace_noalloc(output, BACKTRACE_BUFFER_SIZE);
   for (const char* p = output; *p; p += strlen(p) + 1) {
-    trace.AppendElement(nsDependentCString(p));
+    trace.AppendElement()->Assign(p);
   }
 
   return trace;
 }
 
 // Generate a random number in [0, 1).
 double
 ProfilerImpl::DRandom()