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

Unified Diff: base/mac/scoped_mach_vm.h

Issue 278923002: Use the new ScopedMachVM class and the MACH_LOG family of logging macros (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto r269793 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 | « base/mac/scoped_mach_port.h ('k') | base/mac/scoped_mach_vm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/scoped_mach_vm.h
diff --git a/base/mac/scoped_mach_vm.h b/base/mac/scoped_mach_vm.h
index 065b968f37a98253a16971a29bdaf05faf0ef24e..b130a79fb6329b7961bf8252832f92a4b6c12f90 100644
--- a/base/mac/scoped_mach_vm.h
+++ b/base/mac/scoped_mach_vm.h
@@ -6,15 +6,15 @@
#define BASE_MAC_SCOPED_MACH_VM_H_
#include <mach/mach.h>
-#include <mach/mach_vm.h>
#include <algorithm>
+#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/logging.h"
// Use ScopedMachVM to supervise ownership of pages in the current process
-// through the Mach VM subsystem. Pages allocated with mach_vm_allocate can be
+// through the Mach VM subsystem. Pages allocated with vm_allocate can be
// released when exiting a scope with ScopedMachVM.
//
// The Mach VM subsystem operates on a page-by-page basis, and a single VM
@@ -33,10 +33,10 @@
//
// Example:
//
-// mach_vm_address_t address = 0;
-// mach_vm_size_t size = 12345; // This requested size is not page-aligned.
+// vm_address_t address = 0;
+// vm_size_t size = 12345; // This requested size is not page-aligned.
// kern_return_t kr =
-// mach_vm_allocate(mach_task_self(), &address, size, VM_FLAGS_ANYWHERE);
+// vm_allocate(mach_task_self(), &address, size, VM_FLAGS_ANYWHERE);
// if (kr != KERN_SUCCESS) {
// return false;
// }
@@ -45,9 +45,9 @@
namespace base {
namespace mac {
-class ScopedMachVM {
+class BASE_EXPORT ScopedMachVM {
public:
- explicit ScopedMachVM(mach_vm_address_t address = 0, mach_vm_size_t size = 0)
+ explicit ScopedMachVM(vm_address_t address = 0, vm_size_t size = 0)
: address_(address),
size_(size) {
DCHECK(address % PAGE_SIZE == 0);
@@ -56,17 +56,17 @@ class ScopedMachVM {
~ScopedMachVM() {
if (size_) {
- mach_vm_deallocate(mach_task_self(), address_, size_);
+ vm_deallocate(mach_task_self(), address_, size_);
}
}
- void reset(mach_vm_address_t address = 0, mach_vm_size_t size = 0);
+ void reset(vm_address_t address = 0, vm_size_t size = 0);
- mach_vm_address_t address() const {
+ vm_address_t address() const {
return address_;
}
- mach_vm_size_t size() const {
+ vm_size_t size() const {
return size_;
}
@@ -81,8 +81,8 @@ class ScopedMachVM {
}
private:
- mach_vm_address_t address_;
- mach_vm_size_t size_;
+ vm_address_t address_;
+ vm_size_t size_;
DISALLOW_COPY_AND_ASSIGN(ScopedMachVM);
};
« no previous file with comments | « base/mac/scoped_mach_port.h ('k') | base/mac/scoped_mach_vm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698