From b946086b08fd9f1d989b6c26db3d734d7cfe0be4 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 7 Jul 2015 20:16:25 -0700 Subject: [PATCH] Use jemalloc_ffs() rather than ffs(). --- src/chunk.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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;