| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/memory/discardable_memory_mach.h" | 5 #include "base/memory/discardable_memory_mach.h" |
| 6 | 6 |
| 7 #include <mach/mach.h> | 7 #include <mach/mach.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 ret = vm_protect( | 147 ret = vm_protect( |
| 148 mach_task_self(), memory_.address(), memory_.size(), FALSE, VM_PROT_NONE); | 148 mach_task_self(), memory_.address(), memory_.size(), FALSE, VM_PROT_NONE); |
| 149 MACH_DCHECK(ret == KERN_SUCCESS, ret) << "vm_protect"; | 149 MACH_DCHECK(ret == KERN_SUCCESS, ret) << "vm_protect"; |
| 150 #endif | 150 #endif |
| 151 } | 151 } |
| 152 | 152 |
| 153 void DiscardableMemoryMach::Purge() { | 153 void DiscardableMemoryMach::Purge() { |
| 154 memory_.reset(); | 154 memory_.reset(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool DiscardableMemoryMach::IsMemoryResident() const { |
| 158 return true; |
| 159 } |
| 160 |
| 157 } // namespace internal | 161 } // namespace internal |
| 158 } // namespace base | 162 } // namespace base |
| OLD | NEW |