Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/address.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Absolute address range and sentinels follow Tsavorite's `LogAddress`.
//! Grossular does not yet represent the read-cache marker in bit 47.
//!
//! Reference: `Tsavorite/cs/src/core/Index/Common/LogAddress.cs`
//! at Garnet commit `c9607605baa4`.

use std::fmt;

#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
Expand Down
5 changes: 5 additions & 0 deletions src/hash.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! Port of Tsavorite's `Utility.HashBytes`.
//!
//! Reference: `Tsavorite/cs/src/core/Utilities/Utility.cs`
//! at Garnet commit `c9607605baa4`.

const HASH_MULTIPLIER: u64 = 40_343;

pub(crate) fn hash(key: &[u8]) -> u64 {
Expand Down
10 changes: 10 additions & 0 deletions src/index/bucket.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//! Tag positions and cache-line bucket shape mirror Tsavorite's hash index.
//! Grossular currently reserves, but does not represent, the read-cache address bit.
//!
//! References:
//! - `Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs`
//! - `Tsavorite/cs/src/core/Index/Tsavorite/HashBucket.cs`
//! - `Tsavorite/cs/src/core/Index/Tsavorite/Constants.cs`
//!
//! Garnet commit: `c9607605baa4`.

use crate::address::Address;

pub(super) const ENTRIES_PER_BUCKET: usize = 7;
Expand Down
6 changes: 6 additions & 0 deletions src/record/data_header.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Uses the bit positions from Tsavorite's `RecordDataHeader`.
//! Grossular currently implements only inline keys, inline values, and filler.
//!
//! Reference: `Tsavorite/cs/src/core/Allocator/RecordDataHeader.cs`
//! at Garnet commit `c9607605baa4`.

use super::{ALIGNMENT, HEADER_SIZE};

#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
Expand Down
6 changes: 6 additions & 0 deletions src/record/info.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Bit positions mirror Tsavorite's `RecordInfo`.
//! Grossular currently uses previous address, tombstone, and valid state only.
//!
//! Reference: `Tsavorite/cs/src/core/Index/Common/RecordInfo.cs`
//! at Garnet commit `c9607605baa4`.

use crate::address::Address;

#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
Expand Down