Files
Viano-Core/dep/jemalloc/src/ticker.py
Shauren b17996419b Dep/jemalloc: Update to 5.3.0
Closes #31684

(cherry picked from commit ec31dc8d3ce302e42c26359adc894bd736a45fb2)
2026-02-28 11:17:30 +01:00

16 lines
396 B
Python

#!/usr/bin/env python3
import math
# Must match TICKER_GEOM_NBITS
lg_table_size = 6
table_size = 2**lg_table_size
byte_max = 255
mul = math.floor(-byte_max/math.log(1 / table_size))
values = [round(-mul * math.log(i / table_size))
for i in range(1, table_size+1)]
print("mul =", mul)
print("values:")
for i in range(table_size // 8):
print(", ".join((str(x) for x in values[i*8 : i*8 + 8])))