Refactor jemalloc_ffs*() into ffs_*().

Use appropriate versions to resolve 64-to-32-bit data loss warnings.
This commit is contained in:
Jason Evans
2016-02-24 10:32:45 -08:00
parent b41a07c31a
commit 9f4ee6034c
8 changed files with 72 additions and 42 deletions

View File

@@ -3391,8 +3391,7 @@ bin_info_run_size_calc(arena_bin_info_t *bin_info)
* be twice as large in order to maintain alignment.
*/
if (config_fill && unlikely(opt_redzone)) {
size_t align_min = ZU(1) << (jemalloc_ffs(bin_info->reg_size) -
1);
size_t align_min = ZU(1) << (ffs_zu(bin_info->reg_size) - 1);
if (align_min <= REDZONE_MINSIZE) {
bin_info->redzone_size = REDZONE_MINSIZE;
pad_size = 0;

View File

@@ -716,7 +716,7 @@ chunk_boot(void)
* so pages_map will always take fast path.
*/
if (!opt_lg_chunk) {
opt_lg_chunk = jemalloc_ffs((int)info.dwAllocationGranularity)
opt_lg_chunk = ffs_u((unsigned)info.dwAllocationGranularity)
- 1;
}
#else