OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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.h" | 5 #include "base/memory/discardable_memory.h" |
6 | 6 |
7 #include <mach/mach.h> | 7 #include <mach/mach.h> |
8 #include <mach/mach_vm.h> | |
9 | 8 |
10 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
12 #include "base/logging.h" | 11 #include "base/logging.h" |
13 #include "base/mac/mach_logging.h" | 12 #include "base/mac/mach_logging.h" |
14 #include "base/mac/scoped_mach_vm.h" | 13 #include "base/mac/scoped_mach_vm.h" |
15 #include "base/memory/discardable_memory_emulated.h" | 14 #include "base/memory/discardable_memory_emulated.h" |
16 #include "base/memory/discardable_memory_malloc.h" | 15 #include "base/memory/discardable_memory_malloc.h" |
17 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
18 | 17 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 156 } |
158 | 157 |
159 // static | 158 // static |
160 void DiscardableMemory::PurgeForTesting() { | 159 void DiscardableMemory::PurgeForTesting() { |
161 int state = 0; | 160 int state = 0; |
162 vm_purgable_control(mach_task_self(), 0, VM_PURGABLE_PURGE_ALL, &state); | 161 vm_purgable_control(mach_task_self(), 0, VM_PURGABLE_PURGE_ALL, &state); |
163 internal::DiscardableMemoryEmulated::PurgeForTesting(); | 162 internal::DiscardableMemoryEmulated::PurgeForTesting(); |
164 } | 163 } |
165 | 164 |
166 } // namespace base | 165 } // namespace base |
OLD | NEW |