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>
This commit is contained in:
Arthur Wang 2024-05-13 09:47:57 -07:00 committed by Crashpad LUCI CQ
parent 1174aa4fc3
commit 4f99326c2e

View File

@ -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 @@ inline void Assign<UInt64Array4, UInt32Array4>(UInt64Array4* destination,
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) { \