@jripley Okay, thank you.
Repeating what you said back to you:
On normal UNIX/Linux, mmap, mprotect and mlock all use sysconf(_SC_PAGE_SIZE) multiples. But on recent MacOS, mprotect and mlock may use a different size; using sysconf(_SC_PAGE_SIZE) is always safe, but a smaller (divisor) size may potentially be allowed.
If this is correct, my question is:
How do I find out the allowed mprotect/mlock size multiple on mac?