diff options
Diffstat (limited to 'vendor/gix/src/repository/init.rs')
-rw-r--r-- | vendor/gix/src/repository/init.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/gix/src/repository/init.rs b/vendor/gix/src/repository/init.rs index 16659a013..255ff90d6 100644 --- a/vendor/gix/src/repository/init.rs +++ b/vendor/gix/src/repository/init.rs @@ -37,7 +37,12 @@ fn setup_objects(mut objects: crate::OdbHandle, config: &crate::config::Cache) - #[cfg(feature = "max-performance-safe")] { match config.pack_cache_bytes { - None => objects.set_pack_cache(|| Box::<gix_pack::cache::lru::StaticLinkedList<64>>::default()), + None => match config.static_pack_cache_limit_bytes { + None => objects.set_pack_cache(|| Box::<gix_pack::cache::lru::StaticLinkedList<64>>::default()), + Some(limit) => { + objects.set_pack_cache(move || Box::new(gix_pack::cache::lru::StaticLinkedList::<64>::new(limit))) + } + }, Some(0) => objects.unset_pack_cache(), Some(bytes) => objects.set_pack_cache(move || -> Box<gix_odb::cache::PackCache> { Box::new(gix_pack::cache::lru::MemoryCappedHashmap::new(bytes)) |