Lines Matching refs:bin_info

301 arena_run_reg_alloc(arena_run_t *run, arena_bin_info_t *bin_info)  in arena_run_reg_alloc()  argument
309 assert(!bitmap_full(run->bitmap, &bin_info->bitmap_info)); in arena_run_reg_alloc()
311 regind = (unsigned)bitmap_sfu(run->bitmap, &bin_info->bitmap_info); in arena_run_reg_alloc()
314 ret = (void *)((uintptr_t)rpages + (uintptr_t)bin_info->reg0_offset + in arena_run_reg_alloc()
315 (uintptr_t)(bin_info->reg_interval * regind)); in arena_run_reg_alloc()
327 arena_bin_info_t *bin_info = &arena_bin_info[binind]; in arena_run_reg_dalloc() local
328 size_t regind = arena_run_regind(run, bin_info, ptr); in arena_run_reg_dalloc()
330 assert(run->nfree < bin_info->nregs); in arena_run_reg_dalloc()
334 (uintptr_t)bin_info->reg0_offset)) % in arena_run_reg_dalloc()
335 (uintptr_t)bin_info->reg_interval == 0); in arena_run_reg_dalloc()
338 (uintptr_t)bin_info->reg0_offset); in arena_run_reg_dalloc()
340 assert(bitmap_get(run->bitmap, &bin_info->bitmap_info, regind)); in arena_run_reg_dalloc()
342 bitmap_unset(run->bitmap, &bin_info->bitmap_info, regind); in arena_run_reg_dalloc()
1895 arena_bin_info_t *bin_info = &arena_bin_info[run->binind]; in arena_run_size_get() local
1896 size = bin_info->run_size; in arena_run_size_get()
2110 arena_bin_info_t *bin_info; in arena_bin_nonfull_run_get() local
2119 bin_info = &arena_bin_info[binind]; in arena_bin_nonfull_run_get()
2125 run = arena_run_alloc_small(arena, bin_info->run_size, binind); in arena_bin_nonfull_run_get()
2129 run->nfree = bin_info->nregs; in arena_bin_nonfull_run_get()
2130 bitmap_init(run->bitmap, &bin_info->bitmap_info); in arena_bin_nonfull_run_get()
2160 arena_bin_info_t *bin_info; in arena_bin_malloc_hard() local
2164 bin_info = &arena_bin_info[binind]; in arena_bin_malloc_hard()
2174 ret = arena_run_reg_alloc(bin->runcur, bin_info); in arena_bin_malloc_hard()
2187 if (run->nfree == bin_info->nregs) in arena_bin_malloc_hard()
2202 return (arena_run_reg_alloc(bin->runcur, bin_info)); in arena_bin_malloc_hard()
2258 arena_alloc_junk_small(void *ptr, arena_bin_info_t *bin_info, bool zero) in arena_alloc_junk_small() argument
2262 size_t redzone_size = bin_info->redzone_size; in arena_alloc_junk_small()
2265 memset((void *)((uintptr_t)ptr + bin_info->reg_size), 0xa5, in arena_alloc_junk_small()
2268 memset((void *)((uintptr_t)ptr - bin_info->redzone_size), 0xa5, in arena_alloc_junk_small()
2269 bin_info->reg_interval); in arena_alloc_junk_small()
2294 arena_redzones_validate(void *ptr, arena_bin_info_t *bin_info, bool reset) in arena_redzones_validate() argument
2299 size_t size = bin_info->reg_size; in arena_redzones_validate()
2300 size_t redzone_size = bin_info->redzone_size; in arena_redzones_validate()
2334 arena_dalloc_junk_small(void *ptr, arena_bin_info_t *bin_info) in arena_dalloc_junk_small() argument
2336 size_t redzone_size = bin_info->redzone_size; in arena_dalloc_junk_small()
2338 arena_redzones_validate(ptr, bin_info, false); in arena_dalloc_junk_small()
2340 bin_info->reg_interval); in arena_dalloc_junk_small()
2353 arena_bin_info_t *bin_info; in arena_quarantine_junk_small() local
2360 bin_info = &arena_bin_info[binind]; in arena_quarantine_junk_small()
2361 arena_redzones_validate(ptr, bin_info, true); in arena_quarantine_junk_small()
2654 arena_bin_info_t *bin_info = &arena_bin_info[binind]; in arena_dissociate_bin_run() local
2656 if (bin_info->nregs != 1) { in arena_dissociate_bin_run()
2715 arena_bin_info_t *bin_info; in arena_dalloc_bin_locked_impl() local
2723 bin_info = &arena_bin_info[binind]; in arena_dalloc_bin_locked_impl()
2726 arena_dalloc_junk_small(ptr, bin_info); in arena_dalloc_bin_locked_impl()
2729 if (run->nfree == bin_info->nregs) { in arena_dalloc_bin_locked_impl()
3429 bin_info_run_size_calc(arena_bin_info_t *bin_info) in bin_info_run_size_calc() argument
3443 size_t align_min = ZU(1) << (ffs_zu(bin_info->reg_size) - 1); in bin_info_run_size_calc()
3445 bin_info->redzone_size = REDZONE_MINSIZE; in bin_info_run_size_calc()
3448 bin_info->redzone_size = align_min >> 1; in bin_info_run_size_calc()
3449 pad_size = bin_info->redzone_size; in bin_info_run_size_calc()
3452 bin_info->redzone_size = 0; in bin_info_run_size_calc()
3455 bin_info->reg_interval = bin_info->reg_size + in bin_info_run_size_calc()
3456 (bin_info->redzone_size << 1); in bin_info_run_size_calc()
3463 try_nregs = (uint32_t)(try_run_size / bin_info->reg_size); in bin_info_run_size_calc()
3469 try_nregs = (uint32_t)(try_run_size / bin_info->reg_size); in bin_info_run_size_calc()
3470 } while (perfect_run_size != perfect_nregs * bin_info->reg_size); in bin_info_run_size_calc()
3475 bin_info->reg_interval); in bin_info_run_size_calc()
3488 bin_info->reg_interval); in bin_info_run_size_calc()
3497 bin_info->reg_interval); in bin_info_run_size_calc()
3503 bin_info->run_size = actual_run_size; in bin_info_run_size_calc()
3504 bin_info->nregs = actual_nregs; in bin_info_run_size_calc()
3505 bin_info->reg0_offset = (uint32_t)(actual_run_size - (actual_nregs * in bin_info_run_size_calc()
3506 bin_info->reg_interval) - pad_size + bin_info->redzone_size); in bin_info_run_size_calc()
3511 assert(bin_info->reg0_offset - bin_info->redzone_size + (bin_info->nregs in bin_info_run_size_calc()
3512 * bin_info->reg_interval) + pad_size == bin_info->run_size); in bin_info_run_size_calc()
3518 arena_bin_info_t *bin_info; in bin_info_init() local
3521 bin_info = &arena_bin_info[index]; \ in bin_info_init()
3522 bin_info->reg_size = size; \ in bin_info_init()
3523 bin_info_run_size_calc(bin_info); \ in bin_info_init()
3524 bitmap_info_init(&bin_info->bitmap_info, bin_info->nregs); in bin_info_init()
3546 arena_bin_info_t *bin_info = &arena_bin_info[index]; \ in small_run_size_init()
3547 small_run_tab[bin_info->run_size >> LG_PAGE] = true; \ in small_run_size_init()