Skip to content

Commit

Permalink
Bug 1237265 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in tool…
Browse files Browse the repository at this point in the history
…s/memory-profiler/; r=kanru
  • Loading branch information
froydnj committed Dec 6, 2015
1 parent c594aa4 commit 523f2fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/memory-profiler/MemoryProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/Move.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h"

#include "GCHeapProfilerImpl.h"
#include "GeckoProfiler.h"
Expand Down Expand Up @@ -42,10 +43,10 @@ nsTArray<nsCString>
ProfilerImpl::GetStacktrace()
{
nsTArray<nsCString> trace;
nsAutoArrayPtr<char> output(new char[BACKTRACE_BUFFER_SIZE]);
auto output = MakeUnique<char[]>(BACKTRACE_BUFFER_SIZE);

profiler_get_backtrace_noalloc(output, BACKTRACE_BUFFER_SIZE);
for (const char* p = output; *p; p += strlen(p) + 1) {
profiler_get_backtrace_noalloc(output.get(), BACKTRACE_BUFFER_SIZE);
for (const char* p = output.get(); *p; p += strlen(p) + 1) {
trace.AppendElement()->Assign(p);
}

Expand Down

0 comments on commit 523f2fa

Please sign in to comment.