我想知道mach_vm_allocate
和vm_allocate
之间有什么区别。我知道 mach_vm_allocate
仅在 OS X 而不是 iOS 中可用,但我不确定为什么。包含 mach_vm_...
函数 (mach/mach_vm.h)
的所有函数原型(prototype)的文件只有 #error mach_vm.h 不受支持。
在 iOS 中。
最佳答案
Mac OS X 10.4 中引入的新 Mach VM API。从程序员的角度来看,新 API 与旧 API 基本相同,但存在以下主要区别。
-Routine names have the mach_ prefixfor example, vm_allocate() becomes mach_vm_allocate() .
-Data types used in routines have been updated to support both 64-bit and 32-bit tasks. Consequently, the new API can be used with any task.
The new and old APIs are exported by different MIG subsystems: mach_vm and vm_map , respectively. The corresponding header files are <mach/mach_vm.h> and <mach/vm_map.h> , respectively.
关于ios - mach_vm_allocate 和 vm_allocate 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15049662/