lsm-tree-0.1.0.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.BloomFilter.Blocked.BitArray

Description

Blocked bit array implementation. This uses blocks of 64 bytes, aligned to 64byte boundaries to match typical cache line sizes. This means that multiple accesses to the same block only require a single cache line load or store.

Synopsis

Documentation

newtype NumBlocks Source #

Blocks are 512 bits, 64 bytes.

Constructors

NumBlocks Int 

Instances

Instances details
Eq NumBlocks Source # 
Instance details

Defined in Data.BloomFilter.Blocked.BitArray

bitsToBlocks :: Int -> NumBlocks Source #

The number of 512-bit blocks for the given number of bits. This rounds up to the nearest multiple of 512.

newtype BlockIx Source #

Constructors

BlockIx Word 

newtype BitIx Source #

Constructors

BitIx Int 

newtype BitArray Source #

An array of blocks of bits.

Each block is 512 bits (64 bytes large), corresponding to a cache line on most current architectures.

It is represented by an array of Word64. This array is aligned to 64 bytes so that multiple accesses within a single block will use only one cache line.

Constructors

BitArray (PrimArray Word64) 

Instances

Instances details
Show BitArray Source # 
Instance details

Defined in Data.BloomFilter.Blocked.BitArray

Eq BitArray Source # 
Instance details

Defined in Data.BloomFilter.Blocked.BitArray

newtype MBitArray s Source #

new :: NumBlocks -> ST s (MBitArray s) Source #

We create an explicitly pinned byte array, aligned to 64 bytes.

deserialise :: PrimMonad m => MBitArray (PrimState m) -> (MutableByteArray (PrimState m) -> Int -> Int -> m ()) -> m () Source #

Do an inplace overwrite of the byte array representing the bit block.