histogram: use mi_bsr as it does the subtraction for us

This commit is contained in:
Michael Clark 2022-01-20 19:34:26 +13:00
parent b797c72b2f
commit 109ff12cd5
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 6BF1D7B357EF3E4F

View file

@ -459,7 +459,8 @@ static _Atomic(size_t) mi_hist[MI_SIZE_BITS] = { 0 };
void _mi_histogram_log(size_t size) 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); mi_atomic_increment_relaxed(mi_hist + bucket);
} }