Skip to main content

bloom_bitset/blocked/
struct.rs

1use super::*;
2
3/// Single 64-byte cache-line-aligned 512-bit Bloom block.
4#[repr(align(64))]
5#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6pub(crate) struct BloomBlock {
7    /// Eight 64-bit bitset words totaling 512 bits.
8    pub(crate) words: [u64; BLOCK_WORDS],
9}
10
11/// Cache-line-blocked Bloom filter where every lookup and insert touches at most one 64-byte cache line.
12#[derive(Clone, Debug, Eq, PartialEq)]
13pub struct BlockedBloomFilter {
14    /// Vector of 512-bit cache-line-aligned blocks.
15    pub(crate) blocks: Vec<BloomBlock>,
16    /// Number of hash probes applied inside the selected 512-bit block (`1..=16`).
17    pub(crate) hash_count: u32,
18}