mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-14 17:06:22 +03:00
Use jemalloc_ffs() rather than ffs().
This commit is contained in:
parent
0313607e66
commit
b946086b08
1 changed files with 12 additions and 4 deletions
16
src/chunk.c
16
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue