Chromium Code Reviews| Index: base/process/memory_mac.mm |
| diff --git a/base/process/memory_mac.mm b/base/process/memory_mac.mm |
| index 6cf1297b26f01f680f4da4917bf175259122a2db..fbbea1c3aa29eaef68356f621621b7c864097b46 100644 |
| --- a/base/process/memory_mac.mm |
| +++ b/base/process/memory_mac.mm |
| @@ -16,6 +16,7 @@ |
| #include "base/lazy_instance.h" |
| #include "base/logging.h" |
| #include "base/mac/mac_util.h" |
| +#include "base/mac/mach_logging.h" |
| #include "base/scoped_clear_errno.h" |
| #include "third_party/apple_apsl/CFBase.h" |
| #include "third_party/apple_apsl/malloc.h" |
| @@ -222,10 +223,9 @@ void DeprotectMallocZone(ChromeMallocZone* default_zone, |
| reinterpret_cast<vm_region_info_t>(&info), |
| &count, |
| &unused); |
| - CHECK(result == KERN_SUCCESS); |
| + MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_region"; |
| - result = mach_port_deallocate(mach_task_self(), unused); |
| - CHECK(result == KERN_SUCCESS); |
| + mach_port_deallocate(mach_task_self(), unused); |
|
Robert Sesek
2014/05/09 20:40:01
Technically this _can_ fail. But it's not likely.
Mark Mentovai
2014/05/09 21:09:35
rsesek wrote:
|
| // Does the region fully enclose the zone pointers? Possibly unwarranted |
| // simplification used: using the size of a full version 8 malloc zone rather |
| @@ -248,7 +248,7 @@ void DeprotectMallocZone(ChromeMallocZone* default_zone, |
| *reprotection_length, |
| false, |
| info.protection | VM_PROT_WRITE); |
| - CHECK(result == KERN_SUCCESS); |
| + MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_protect"; |
| } |
| } |
| @@ -646,7 +646,7 @@ void EnableTerminationOnOutOfMemory() { |
| default_reprotection_length, |
| false, |
| default_reprotection_value); |
| - CHECK(result == KERN_SUCCESS); |
| + MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_protect"; |
| } |
| if (purgeable_reprotection_start) { |
| @@ -655,7 +655,7 @@ void EnableTerminationOnOutOfMemory() { |
| purgeable_reprotection_length, |
| false, |
| purgeable_reprotection_value); |
| - CHECK(result == KERN_SUCCESS); |
| + MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_protect"; |
| } |
| #endif |