-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new ContempCache1.0 #84
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来新算法没上来,这个commit取名不太合适
@@ -12,7 +12,7 @@ pub struct FifoCache<Payload: Eq + Hash + Clone + Debug> { | |||
} | |||
|
|||
impl<Payload: Eq + Hash + Clone + Debug> InstanceCachePolicy<Payload> for FifoCache<Payload> { | |||
fn get(&mut self, key: Payload) -> Option<Payload> { | |||
fn get(&mut self, key: Payload, last_mem_use: f32) -> Option<Payload> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
能不能直接传进来该缓存所在的节点对应的实例的状态,不然后续你扩展新的缓存可能要观测别的数据,又得传新的变量;随着策略增多改动会越来越麻烦
@@ -13,7 +13,7 @@ pub struct LRUCache<Payload: Eq + Hash + Clone + Debug> { | |||
} | |||
|
|||
impl<Payload: Eq + Hash + Clone + Debug> InstanceCachePolicy<Payload> for LRUCache<Payload> { | |||
fn get(&mut self, key: Payload) -> Option<Payload> { | |||
fn get(&mut self, key: Payload, last_mem_use: f32) -> Option<Payload> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
}; | ||
use std::{ collections::HashMap, fs::File }; | ||
use std::{collections::HashMap, fs::File, ptr::NonNull}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NonNull 没用去掉吧,可以跑一遍cargo fix
@@ -209,7 +217,7 @@ impl Node { | |||
// self.fn_containers.get(&fnid) | |||
// } | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里加上的注释解释下if down的作用吧
No description provided.