Replace std::unique_ptr with base::HeapArray in process_memory.cc
Bug: crashpad:326459219
Change-Id: Ic5e252285ed1fb1769eef67ddaea00a830d0ee6a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5535006
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Arthur Wang <wuwang@chromium.org>
diff --git a/snapshot/mac/process_types.cc b/snapshot/mac/process_types.cc
index bc30317..b2be03c 100644
--- a/snapshot/mac/process_types.cc
+++ b/snapshot/mac/process_types.cc
@@ -19,8 +19,8 @@
#include <uuid/uuid.h>
#include <iterator>
-#include <memory>
+#include "base/containers/heap_array.h"
#include "snapshot/mac/process_types/internal.h"
#include "util/process/process_memory_mac.h"
@@ -245,8 +245,9 @@
mach_vm_address_t address, \
size_t count, \
struct_name* generic) { \
- std::unique_ptr<T[]> specific(new T[count]); \
- if (!T::ReadArrayInto(process_reader, address, count, &specific[0])) { \
+ auto specific = base::HeapArray<T>::Uninit(count); \
+ if (!T::ReadArrayInto( \
+ process_reader, address, specific.size(), specific.data())) { \
return false; \
} \
for (size_t index = 0; index < count; ++index) { \