Lines Matching refs:bin_info
280 arena_run_reg_alloc(arena_run_t *run, arena_bin_info_t *bin_info) in arena_run_reg_alloc() argument
288 assert(!bitmap_full(run->bitmap, &bin_info->bitmap_info)); in arena_run_reg_alloc()
290 regind = (unsigned)bitmap_sfu(run->bitmap, &bin_info->bitmap_info); in arena_run_reg_alloc()
293 ret = (void *)((uintptr_t)rpages + (uintptr_t)bin_info->reg0_offset + in arena_run_reg_alloc()
294 (uintptr_t)(bin_info->reg_interval * regind)); in arena_run_reg_alloc()
306 arena_bin_info_t *bin_info = &arena_bin_info[binind]; in arena_run_reg_dalloc() local
307 size_t regind = arena_run_regind(run, bin_info, ptr); in arena_run_reg_dalloc()
309 assert(run->nfree < bin_info->nregs); in arena_run_reg_dalloc()
313 (uintptr_t)bin_info->reg0_offset)) % in arena_run_reg_dalloc()
314 (uintptr_t)bin_info->reg_interval == 0); in arena_run_reg_dalloc()
317 (uintptr_t)bin_info->reg0_offset); in arena_run_reg_dalloc()
319 assert(bitmap_get(run->bitmap, &bin_info->bitmap_info, regind)); in arena_run_reg_dalloc()
321 bitmap_unset(run->bitmap, &bin_info->bitmap_info, regind); in arena_run_reg_dalloc()
1889 arena_bin_info_t *bin_info = in arena_achunk_prof_reset() local
1891 npages = bin_info->run_size >> LG_PAGE; in arena_achunk_prof_reset()
2112 arena_bin_info_t *bin_info = &arena_bin_info[run->binind]; in arena_run_size_get() local
2113 size = bin_info->run_size; in arena_run_size_get()
2308 arena_bin_info_t *bin_info; in arena_bin_nonfull_run_get() local
2317 bin_info = &arena_bin_info[binind]; in arena_bin_nonfull_run_get()
2323 run = arena_run_alloc_small(tsdn, arena, bin_info->run_size, binind); in arena_bin_nonfull_run_get()
2327 run->nfree = bin_info->nregs; in arena_bin_nonfull_run_get()
2328 bitmap_init(run->bitmap, &bin_info->bitmap_info); in arena_bin_nonfull_run_get()
2358 arena_bin_info_t *bin_info; in arena_bin_malloc_hard() local
2362 bin_info = &arena_bin_info[binind]; in arena_bin_malloc_hard()
2372 ret = arena_run_reg_alloc(bin->runcur, bin_info); in arena_bin_malloc_hard()
2385 if (run->nfree == bin_info->nregs) { in arena_bin_malloc_hard()
2401 return (arena_run_reg_alloc(bin->runcur, bin_info)); in arena_bin_malloc_hard()
2457 arena_alloc_junk_small(void *ptr, arena_bin_info_t *bin_info, bool zero) in arena_alloc_junk_small() argument
2460 size_t redzone_size = bin_info->redzone_size; in arena_alloc_junk_small()
2465 memset((void *)((uintptr_t)ptr + bin_info->reg_size), in arena_alloc_junk_small()
2469 JEMALLOC_ALLOC_JUNK, bin_info->reg_interval); in arena_alloc_junk_small()
2494 arena_redzones_validate(void *ptr, arena_bin_info_t *bin_info, bool reset) in arena_redzones_validate() argument
2499 size_t size = bin_info->reg_size; in arena_redzones_validate()
2500 size_t redzone_size = bin_info->redzone_size; in arena_redzones_validate()
2534 arena_dalloc_junk_small(void *ptr, arena_bin_info_t *bin_info) in arena_dalloc_junk_small() argument
2536 size_t redzone_size = bin_info->redzone_size; in arena_dalloc_junk_small()
2538 arena_redzones_validate(ptr, bin_info, false); in arena_dalloc_junk_small()
2540 bin_info->reg_interval); in arena_dalloc_junk_small()
2553 arena_bin_info_t *bin_info; in arena_quarantine_junk_small() local
2560 bin_info = &arena_bin_info[binind]; in arena_quarantine_junk_small()
2561 arena_redzones_validate(ptr, bin_info, true); in arena_quarantine_junk_small()
2859 arena_bin_info_t *bin_info = &arena_bin_info[binind]; in arena_dissociate_bin_run() local
2866 if (bin_info->nregs != 1) { in arena_dissociate_bin_run()
2923 arena_bin_info_t *bin_info; in arena_dalloc_bin_locked_impl() local
2931 bin_info = &arena_bin_info[binind]; in arena_dalloc_bin_locked_impl()
2934 arena_dalloc_junk_small(ptr, bin_info); in arena_dalloc_bin_locked_impl()
2937 if (run->nfree == bin_info->nregs) { in arena_dalloc_bin_locked_impl()
3656 bin_info_run_size_calc(arena_bin_info_t *bin_info) in bin_info_run_size_calc() argument
3670 size_t align_min = ZU(1) << (ffs_zu(bin_info->reg_size) - 1); in bin_info_run_size_calc()
3672 bin_info->redzone_size = REDZONE_MINSIZE; in bin_info_run_size_calc()
3675 bin_info->redzone_size = align_min >> 1; in bin_info_run_size_calc()
3676 pad_size = bin_info->redzone_size; in bin_info_run_size_calc()
3679 bin_info->redzone_size = 0; in bin_info_run_size_calc()
3682 bin_info->reg_interval = bin_info->reg_size + in bin_info_run_size_calc()
3683 (bin_info->redzone_size << 1); in bin_info_run_size_calc()
3690 try_nregs = (uint32_t)(try_run_size / bin_info->reg_size); in bin_info_run_size_calc()
3696 try_nregs = (uint32_t)(try_run_size / bin_info->reg_size); in bin_info_run_size_calc()
3697 } while (perfect_run_size != perfect_nregs * bin_info->reg_size); in bin_info_run_size_calc()
3702 bin_info->reg_interval); in bin_info_run_size_calc()
3715 bin_info->reg_interval); in bin_info_run_size_calc()
3724 bin_info->reg_interval); in bin_info_run_size_calc()
3730 bin_info->run_size = actual_run_size; in bin_info_run_size_calc()
3731 bin_info->nregs = actual_nregs; in bin_info_run_size_calc()
3732 bin_info->reg0_offset = (uint32_t)(actual_run_size - (actual_nregs * in bin_info_run_size_calc()
3733 bin_info->reg_interval) - pad_size + bin_info->redzone_size); in bin_info_run_size_calc()
3735 assert(bin_info->reg0_offset - bin_info->redzone_size + (bin_info->nregs in bin_info_run_size_calc()
3736 * bin_info->reg_interval) + pad_size == bin_info->run_size); in bin_info_run_size_calc()
3742 arena_bin_info_t *bin_info; in bin_info_init() local
3745 bin_info = &arena_bin_info[index]; \ in bin_info_init()
3746 bin_info->reg_size = size; \ in bin_info_init()
3747 bin_info_run_size_calc(bin_info); \ in bin_info_init()
3748 bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); in bin_info_init()