mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-21 06:19:31 +03:00
histogram: use mi_bsr as it does the subtraction for us
This commit is contained in:
parent
b797c72b2f
commit
109ff12cd5
1 changed files with 2 additions and 1 deletions
|
@ -459,7 +459,8 @@ static _Atomic(size_t) mi_hist[MI_SIZE_BITS] = { 0 };
|
|||
|
||||
void _mi_histogram_log(size_t size)
|
||||
{
|
||||
size_t bucket = MI_SIZE_BITS - 1 - mi_clz(size);
|
||||
if (mi_unlikely(size == 0)) return;
|
||||
size_t bucket = mi_bsr(size);
|
||||
mi_atomic_increment_relaxed(mi_hist + bucket);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue