快乐虾
http://blog.csdn.net/lights_joy/
lights@hb165.com
本文适用于
Windows xp with sp3
vs2008
cygwin checkout-20080928 (仅指cygwin.dll)
欢迎转载,但请保留作者信息
这个系统调用用于取得内核页面的大小。Cygwin对此的实现为:
extern "C" size_t
getpagesize ()
{
if (!system_info.dwAllocationGranularity)
GetSystemInfo (&system_info);
return (size_t) system_info.dwAllocationGranularity;
}
在这里system_info是一个全局变量:
SYSTEM_INFO system_info;
dwAllocationGranularity这个成员的作用为:
The granularity for the starting address at which virtual memory can be allocated. For more information, see VirtualAlloc.
在xp sp3中,这个值为0x10000,即65536。
1 参考资料
Cygwin中的系统调用(1):前言(2009-3-10)