Skip to content

Commit

Permalink
fix: do not init sequence when insert lru
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Apr 2, 2024
1 parent f9678c3 commit 3959a16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/common/src/lru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ where
key: MaybeUninit::new(key),
value: MaybeUninit::new(value),
hash,
sequence: SEQUENCER.with(|s| s.borrow_mut().inc()),
// sequence will be updated by `attach`
sequence: 0,
},
self.alloc.clone(),
);
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Sequencer {

impl Sequencer {
pub const DEFAULT_LAG: Sequence = Self::DEFAULT_STEP * 16;
pub const DEFAULT_STEP: Sequence = 128;
pub const DEFAULT_STEP: Sequence = 64;

pub const fn new(step: Sequence, lag: Sequence) -> Self {
Self {
Expand Down

0 comments on commit 3959a16

Please sign in to comment.