The LruMap is a hashbrown-based hash map that keeps track of least recently used map entries, allowing operations such as draining the least recently entries in the map. The map also supports an optional time-to-live duration that can be used to drain/remove entries that have timed out.
Generating developer's documentation
The crate documentation contains opt-in detailed descriptions that are useful to developers wanting to understand the crate source code, but that would be considered to be unnecessary noise to regular users of the crate. Build the annotated documentation using:
$ cargo doc --document-private-items --features dev-docs
unsafe
This crate uses a fair amount of unsafe
. While doing work on the unsafe
parts take advantage of tools that are available to detect memory safety
violations:
Tests
In order to avoid artifical delays in tests the test can run using a fake clock
that can progress artifically. The feature fake-clock
can be used when
running tests to enable this feature:
$ cargo test --features fake-clock
Running test with miri
$ cargo +nightly miri test
Running test with sanitizers
To run the tests with the Address Sanitizer, use:
$ RUSTFLAGS=-Zsanitizer=address RUSTDOCFLAGS=-Zsanitizer=address ASAN_OPTIONS=detect_leaks=1 cargo +nightly test
Notes:
- Doc tests do not use
RUSTFLAGS
;RUSTDOCFLAGS
is needed as well or the doc tests will fail to link. - Leak detection is allegedly enabled by default on Linux, so the
ASAN_OPTIONS
variable should only be needed on macOS.
Change log
The details of changes can always be found in the timeline, but for a high-level view of changes between released versions there's a manually maintained Change Log.
Project Status
qlrumap is still in early stages of development.