Browse Source

Make sure the raft state occupies entire L3 cache.

Jing Yang 3 năm trước cách đây
mục cha
commit
17a7dfa1d2
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      src/raft_state.rs

+ 1 - 0
src/raft_state.rs

@@ -10,6 +10,7 @@ pub(crate) enum State {
     Leader,
     Leader,
 }
 }
 
 
+#[repr(align(64))]
 pub(crate) struct RaftState<Command> {
 pub(crate) struct RaftState<Command> {
     pub current_term: Term,
     pub current_term: Term,
     pub voted_for: Option<Peer>,
     pub voted_for: Option<Peer>,