Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Unified Diff: base/memory/discardable_memory_mac.cc

Issue 271353003: Fix iOS after r269483. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_mac.cc
diff --git a/base/memory/discardable_memory_mac.cc b/base/memory/discardable_memory_mac.cc
index 902b5a074497bdde8f0edd0b43252649b8fa7213..3f7acc0208f4635036972ea7a1f3acb00d191b58 100644
--- a/base/memory/discardable_memory_mac.cc
+++ b/base/memory/discardable_memory_mac.cc
@@ -33,15 +33,15 @@ class DiscardableMemoryMac : public DiscardableMemory {
bool Initialize() {
DCHECK_EQ(memory_.size(), 0u);
- mach_vm_address_t address = 0;
- kern_return_t ret = mach_vm_allocate(mach_task_self(),
- &address,
- size_,
- VM_FLAGS_PURGABLE |
- VM_FLAGS_ANYWHERE |
- kDiscardableMemoryTag);
+ vm_address_t address = 0;
+ kern_return_t ret = vm_allocate(mach_task_self(),
+ &address,
+ size_,
+ VM_FLAGS_PURGABLE |
+ VM_FLAGS_ANYWHERE |
+ kDiscardableMemoryTag);
if (ret != KERN_SUCCESS) {
- MACH_DLOG(ERROR, ret) << "mach_vm_allocate";
+ MACH_DLOG(ERROR, ret) << "vm_allocate";
return false;
}
@@ -55,16 +55,16 @@ class DiscardableMemoryMac : public DiscardableMemory {
virtual DiscardableMemoryLockStatus Lock() OVERRIDE {
kern_return_t ret;
- MACH_DCHECK((ret = mach_vm_protect(mach_task_self(),
- memory_.address(),
- memory_.size(),
- FALSE,
- VM_PROT_DEFAULT)) == KERN_SUCCESS, ret);
+ MACH_DCHECK((ret = vm_protect(mach_task_self(),
+ memory_.address(),
+ memory_.size(),
+ FALSE,
+ VM_PROT_DEFAULT)) == KERN_SUCCESS, ret);
int state = VM_PURGABLE_NONVOLATILE;
- ret = mach_vm_purgable_control(mach_task_self(),
- memory_.address(),
- VM_PURGABLE_SET_STATE,
- &state);
+ ret = vm_purgable_control(mach_task_self(),
+ memory_.address(),
+ VM_PURGABLE_SET_STATE,
+ &state);
if (ret != KERN_SUCCESS)
return DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
@@ -74,16 +74,16 @@ class DiscardableMemoryMac : public DiscardableMemory {
virtual void Unlock() OVERRIDE {
int state = VM_PURGABLE_VOLATILE | VM_VOLATILE_GROUP_DEFAULT;
- kern_return_t ret = mach_vm_purgable_control(mach_task_self(),
- memory_.address(),
- VM_PURGABLE_SET_STATE,
- &state);
- MACH_DLOG_IF(ERROR, ret != KERN_SUCCESS, ret) << "mach_vm_purgable_control";
- MACH_DCHECK((ret = mach_vm_protect(mach_task_self(),
- memory_.address(),
- memory_.size(),
- FALSE,
- VM_PROT_NONE)) == KERN_SUCCESS, ret);
+ kern_return_t ret = vm_purgable_control(mach_task_self(),
+ memory_.address(),
+ VM_PURGABLE_SET_STATE,
+ &state);
+ MACH_DLOG_IF(ERROR, ret != KERN_SUCCESS, ret) << "vm_purgable_control";
+ MACH_DCHECK((ret = vm_protect(mach_task_self(),
+ memory_.address(),
+ memory_.size(),
+ FALSE,
+ VM_PROT_NONE)) == KERN_SUCCESS, ret);
}
virtual void* Memory() const OVERRIDE {
@@ -159,7 +159,7 @@ scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
// static
void DiscardableMemory::PurgeForTesting() {
int state = 0;
- mach_vm_purgable_control(mach_task_self(), 0, VM_PURGABLE_PURGE_ALL, &state);
+ vm_purgable_control(mach_task_self(), 0, VM_PURGABLE_PURGE_ALL, &state);
internal::DiscardableMemoryEmulated::PurgeForTesting();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698