Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between mach_vm_allocate and vm_allocate?

I would like to know what's the difference betweenmach_vm_allocate and vm_allocate. I know mach_vm_allocate is only available in OS X and not iOS, but I'm not sure why. The file that has all the function prototypes in for the mach_vm_... functions (mach/mach_vm.h) only has #error mach_vm.h unsupported. in iOS.

like image 307
Roberto Avatar asked Feb 17 '23 10:02

Roberto


2 Answers

the new Mach VM API that is introduced in Mac OS X 10.4. The new API is essentially the same as the old API from the programmer's standpoint, with the following key differences.

-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.

like image 124
Ravindra Bagale Avatar answered Feb 20 '23 00:02

Ravindra Bagale


The new Mach VM API that is introduced in Mac OS X 10.4. The new API is essentially the same as the old API from the programmer's standpoint, with the following key differences:

  • 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.

The information is derived from the book OS X Internals A System Approach.

like image 34
FranklinYang Avatar answered Feb 20 '23 00:02

FranklinYang