Use jemalloc_ffs() rather than ffs().

This commit is contained in:
Jason Evans 2015-07-07 20:16:25 -07:00
parent 0313607e66
commit b946086b08

View File

@ -539,13 +539,21 @@ chunk_boot(void)
SYSTEM_INFO info;
GetSystemInfo(&info);
/* Verify actual page size is equal to or an integral multiple of configured page size */
/*
* Verify actual page size is equal to or an integral multiple of
* configured page size.
*/
if (info.dwPageSize & ((1U << LG_PAGE) - 1))
return (true);
/* Configure chunksize (if not set) to match granularity (usually 64K), so pages_map will always take fast path */
if (!opt_lg_chunk)
opt_lg_chunk = ffs((int)info.dwAllocationGranularity) - 1;
/*
* Configure chunksize (if not set) to match granularity (usually 64K),
* so pages_map will always take fast path.
*/
if (!opt_lg_chunk) {
opt_lg_chunk = jemalloc_ffs((int)info.dwAllocationGranularity)
- 1;
}
#else
if (!opt_lg_chunk)
opt_lg_chunk = LG_CHUNK_DEFAULT;