| Index: third_party/crashpad/crashpad/snapshot/mac/process_types.cc
|
| diff --git a/third_party/crashpad/crashpad/snapshot/mac/process_types.cc b/third_party/crashpad/crashpad/snapshot/mac/process_types.cc
|
| index a34e4d60c496d83a8bbb878848619df8703704cc..53d89035de390d99784ec2bfc20619e7a7b58c7d 100644
|
| --- a/third_party/crashpad/crashpad/snapshot/mac/process_types.cc
|
| +++ b/third_party/crashpad/crashpad/snapshot/mac/process_types.cc
|
| @@ -36,44 +36,39 @@ inline void Assign(DestinationType* destination, const SourceType& source) {
|
| *destination = source;
|
| }
|
|
|
| -template <>
|
| -inline void Assign<process_types::internal::Reserved64Only64,
|
| - process_types::internal::Reserved64Only32>(
|
| - process_types::internal::Reserved64Only64* destination,
|
| - const process_types::internal::Reserved64Only32& source) {
|
| - // Reserved64Only32 carries no data.
|
| - *destination = 0;
|
| +template <typename Type>
|
| +inline void Assign(Type* destination, const Type& source) {
|
| + memcpy(destination, &source, sizeof(source));
|
| }
|
|
|
| -using CharArray16 = char[16];
|
| template <>
|
| -inline void Assign<CharArray16, CharArray16>(CharArray16* destination,
|
| - const CharArray16& source) {
|
| - memcpy(destination, &source, sizeof(source));
|
| +inline void Assign<process_types::internal::Reserved32_64Only64,
|
| + process_types::internal::Reserved32_64Only32>(
|
| + process_types::internal::Reserved32_64Only64* destination,
|
| + const process_types::internal::Reserved32_64Only32& source) {
|
| + // Reserved32_64Only32 carries no data.
|
| + *destination = 0;
|
| }
|
|
|
| -using UInt64Array16 = uint64_t[16];
|
| template <>
|
| -inline void Assign<UInt64Array16, UInt64Array16>(UInt64Array16* destination,
|
| - const UInt64Array16& source) {
|
| - memcpy(destination, &source, sizeof(source));
|
| +inline void Assign<process_types::internal::Reserved64_64Only64,
|
| + process_types::internal::Reserved64_64Only32>(
|
| + process_types::internal::Reserved64_64Only64* destination,
|
| + const process_types::internal::Reserved64_64Only32& source) {
|
| + // Reserved64_64Only32 carries no data.
|
| + *destination = 0;
|
| }
|
|
|
| -using UInt32Array16 = uint32_t[16];
|
| +using UInt32Array4 = uint32_t[4];
|
| +using UInt64Array4 = uint64_t[4];
|
| template <>
|
| -inline void Assign<UInt64Array16, UInt32Array16>(UInt64Array16* destination,
|
| - const UInt32Array16& source) {
|
| +inline void Assign<UInt64Array4, UInt32Array4>(UInt64Array4* destination,
|
| + const UInt32Array4& source) {
|
| for (size_t index = 0; index < arraysize(source); ++index) {
|
| (*destination)[index] = source[index];
|
| }
|
| }
|
|
|
| -template <>
|
| -inline void Assign<uuid_t, uuid_t>(uuid_t* destination, const uuid_t& source) {
|
| - // uuid_t is a type alias for unsigned char[16].
|
| - memcpy(destination, &source, sizeof(source));
|
| -}
|
| -
|
| } // namespace
|
| } // namespace crashpad
|
|
|
|
|