Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否存在最小内存页面(页面大小)的大小不能被 2 或 1024、4096 整除的系统?
可以是3000还是3500?
如果 pagesize 不能被 1024 整除,任何 posix 程序都会中断吗?
您可以放心地假设 pagesize 是 2 的幂,至少在使用三元计算机之前是这样。实际上,现代系统的页面大小是 1024 的倍数。
至于程序破坏,很少有程序关心页面大小,只要内核保持一致,一切都很好。如果一个程序根据页面大小进行计算,并使用带有宏的标题,假设页面大小是 2 的幂(truncpage,roundpage),那么它就会出现问题。