1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/// Number of cache-line-aligned shards in `KeyedRateLimiter`.
pub const KEYED_SHARD_COUNT: usize = 64;
/// Bitmask mapping shifted hash bits to a shard index in `0..64`.
pub const KEYED_SHARD_MASK: usize = KEYED_SHARD_COUNT - 1;
/// Bit shift selecting shard bits independent of table index and H2 tag bits.
pub const KEYED_SHARD_SHIFT: u32 = 50;
/// Secondary mixing salt combined with instance address to seed per-limiter hashing.
pub const SEED_MIX_SALT: u64 = 0x517C_C1B7_2722_0A95;
/// Number of cache-line-isolated per-thread reader slots eliminating cross-core lock bouncing.
pub const READER_SLOT_COUNT: usize = 32;
/// Bitmask mapping thread slot counters into `0..READER_SLOT_COUNT`.
pub const READER_SLOT_MASK: usize = READER_SLOT_COUNT - 1;
/// Uninitialized sentinel for zero-overhead `const` thread-local reader slot storage.
pub const READER_SLOT_UNINIT: usize = usizeMAX;
/// Number of `spin_loop` iterations before yielding to the OS scheduler under write contention.
pub const RW_SPIN_LIMIT: u32 = 32;
/// Control tag marking an unused open-addressing slot.
pub const SLOT_EMPTY: u8 = 0;
/// Control tag marking a previously occupied deleted slot.
pub const SLOT_TOMBSTONE: u8 = 1;
/// High bit set on occupied slot tags (`0x80..=0xFF`).
pub const SLOT_OCCUPIED_BIT: u8 = 0x80;
/// Right shift extracting the 7-bit H2 fingerprint from a 64-bit key hash.
pub const SLOT_H2_SHIFT: u32 = 57;
/// Minimum power-of-two slot capacity allocated when a shard map receives its first entry.
pub const SHARD_MAP_MIN_CAP: usize = 8;