ios - mach_vm_allocate 和 vm_allocate 有什么区别?

标签 ios macos kernel mach

我想知道mach_vm_allocatevm_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/

相关文章:

ios - 在运行时更改 UIBackgroundModes 音频

python - Conda:当前 osx-64 channel 中缺少依赖项

macos - Growl 1.3 在沙盒 Cocoa 应用程序中的使用

c - 访问特定 UID 的 user_struct

linux - QEMU:/bin/sh: 无法访问 tty;作业控制关闭

ios - 如何在 UIWebView 中打开西里尔域名?

iOS 导航 Controller 基础知识和自定义后退按钮

ios - 如何使用 Swift 为 UITableViewCell 设置动画?

c - 如何修复我的 pthread 代码遇到的此错误?

linux - 如何在 Linux 上使用系统调用等待击键中断?