You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mercury/src/internal/pack/cache.rs
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -26,14 +26,20 @@ pub trait _Cache {
26
26
fnclear(&self);
27
27
}
28
28
29
+
impl lru_mem::HeapSizeforSHA1{
30
+
fnheap_size(&self) -> usize{
31
+
0
32
+
}
33
+
}
34
+
29
35
pubstructCaches{
30
36
map_offset:DashMap<usize,SHA1>,// offset to hash
31
37
hash_set:DashSet<SHA1>,// item in the cache
32
38
// dropping large lru cache will take a long time on Windows without multi-thread IO
33
39
// because "multi-thread IO" clone Arc<CacheObject>, so it won't be dropped in the main thread,
34
40
// and `CacheObjects` will be killed by OS after Process ends abnormally
35
41
// Solution: use `mimalloc`
36
-
lru_cache:Mutex<LruCache<String,ArcWrapper<CacheObject>>>,// *lru_cache require the key to implement lru::MemSize trait, so didn't use SHA1 as the key*
0 commit comments