I am currently working on a portable C program which makes use of the memory page size (as returned by
While I can't find any explicit statement that the page size is required to be a power of two, I think it's a very reasonable assumption. The POSIX concept of "alignment" (see
posix_memalign) is defined in terms of powers of two, not arbitrary divisors - specifically, the alignment argument must be a power-of-two multiple of
sizeof(void*) - and it seems that you should be able to achieve page-aligned memory with this interface. Beyond that, all real-world architectures use power-of-two page sizes, and have no reasonable justification for ever changing that; anything else is significantly more costly in hardware.