According to documentation on virtual memory, the system page size is 4096 Bytes (4KB):
That document is out of date. Modern iOS devices support a larger page size. Please file a bug against the doc, and post your bug number, just for the record.
The 64-bit transition guide document states: "Never hard code the page size". The document recommends using getpagesize(), however getpagesize() is deprecated in POSIX and so I am using sysconf() instead.
I typically use
getpagesizefor this. AFAICT it was deprecated by POSIX because it returns an
intbut I think that’s being overly picky. It’s hard to imagine any platform where the page size would overflow the
_SC_PAGESIZEreturn the same value:
16 KiB on 64-bit ARM platforms
4 KiB on everything else
Likewise for the
vm_page_sizeglobal variable (as used by Mach).
One interesting edge case here is that various low-level Mach APIs (those that deal with the kernel’s address space) continue to work in terms of 4 KiB pages. You can get that value using
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"