mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-31 07:28:02 +03:00
Add ticker_geom_t.
This lets a single ticker object drive events across a large number of different tick streams while sharing state.
This commit is contained in:
parent
3967329813
commit
8edfc5b170
9 changed files with 174 additions and 6 deletions
15
src/ticker.py
Executable file
15
src/ticker.py
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/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])))
|
||||
Loading…
Add table
Add a link
Reference in a new issue