Google の TCMalloc ソース コード (Windows への移植) を読んでいます。
int getpagesize()
{
static int pagesize = 0;
if (pagesize == 0)
{
SYSTEM_INFO system_info;
GetSystemInfo(&system_info);
pagesize = std::max(system_info.dwPageSize, system_info.dwAllocationGranularity);
}
return pagesize;
}
上記のコード スニペットでわかるようにpagesize
(つまり、割り当ての単位) は、dwPageSize と dwAllocationGranularity の間の最大値として計算されます。私が知りたいのは、これら 2 つの値の間の関係の種類です。ここで説明されている方法で値を計算する必要がありますか? また、dwPageSize が dwAllocationGranularity より大きくなる状況はありますか?