xref: /netbsd-src/external/bsd/jemalloc/dist/src/ticker.py (revision 7bdf38e5b7a28439665f2fdeff81e36913eef7dd)
1#!/usr/bin/env python3
2
3import math
4
5# Must match TICKER_GEOM_NBITS
6lg_table_size = 6
7table_size = 2**lg_table_size
8byte_max = 255
9mul = math.floor(-byte_max/math.log(1 / table_size))
10values = [round(-mul * math.log(i / table_size))
11	for i in range(1, table_size+1)]
12print("mul =", mul)
13print("values:")
14for i in range(table_size // 8):
15	print(", ".join((str(x) for x in values[i*8 : i*8 + 8])))
16