Constant style::bloom::BLOOM_KEY

source ·
const BLOOM_KEY: LocalKey<ManuallyDrop<Arc<AtomicRefCell<BloomFilter>>>>;
Expand description

Bloom filters are large allocations, so we store them in thread-local storage such that they can be reused across style traversals. StyleBloom is responsible for ensuring that the bloom filter is zeroed when it is dropped.

We intentionally leak this from TLS because we don’t have the guarantee of TLS destructors to run in worker threads.

We could change this once https://github.com/rayon-rs/rayon/issues/688 is fixed, hopefully.