Lines Matching refs:unit_magnitude

171     return pow2ceiling - h->unit_magnitude - (h->sub_bucket_half_count_magnitude + 1);
174 static int32_t get_sub_bucket_index(int64_t value, int32_t bucket_index, int32_t unit_magnitude)
176 return (int32_t)(value >> (bucket_index + unit_magnitude));
190 static int64_t value_from_index(int32_t bucket_index, int32_t sub_bucket_index, int32_t unit_magnitude)
192 return ((int64_t) sub_bucket_index) << (bucket_index + unit_magnitude);
198 int32_t sub_bucket_index = get_sub_bucket_index(value, bucket_index, h->unit_magnitude);
214 return value_from_index(bucket_index, sub_bucket_index, h->unit_magnitude);
220 int32_t sub_bucket_index = get_sub_bucket_index(value, bucket_index, h->unit_magnitude);
222 return INT64_C(1) << (h->unit_magnitude + adjusted_bucket);
231 return INT64_C(1) << (h->unit_magnitude + adjusted_bucket);
237 int32_t sub_bucket_index = get_sub_bucket_index(value, bucket_index, h->unit_magnitude);
238 return value_from_index(bucket_index, sub_bucket_index, h->unit_magnitude);
246 return value_from_index(bucket_index, sub_bucket_index, h->unit_magnitude);
318 static int32_t buckets_needed_to_cover_value(int64_t value, int32_t sub_bucket_count, int32_t unit_magnitude)
320 int64_t smallest_untrackable_value = ((int64_t) sub_bucket_count) << unit_magnitude;
367 double unit_magnitude = log((double)lowest_discernible_value) / log(2);
368 if (INT32_MAX < unit_magnitude)
373 cfg->unit_magnitude = (int32_t) unit_magnitude;
376 cfg->sub_bucket_mask = ((int64_t) cfg->sub_bucket_count - 1) << cfg->unit_magnitude;
378 if (cfg->unit_magnitude + cfg->sub_bucket_half_count_magnitude > 61)
383 cfg->bucket_count = buckets_needed_to_cover_value(highest_trackable_value, cfg->sub_bucket_count, (int32_t)cfg->unit_magnitude);
393 h->unit_magnitude = (int32_t)cfg->unit_magnitude;
827 const int32_t sub_bucket_index = get_sub_bucket_index(value, bucket_index, iter->h->unit_magnitude);