diff --git a/src/chunk.c b/src/chunk.c index b600aba0..9a7bd45e 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -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;