mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-18 08:49:29 -04:00
fix(block_cache): don't prefetch blocks that are in the active list
This commit is contained in:
parent
06b7ddc533
commit
415d570cf2
@ -383,7 +383,8 @@ class block_cache_ final : public block_cache::impl {
|
||||
if (auto next = seq_access_detector_->prefetch()) {
|
||||
std::lock_guard lock(mx_);
|
||||
|
||||
if (cache_.findWithoutPromotion(*next) == cache_.end()) {
|
||||
if (cache_.findWithoutPromotion(*next) == cache_.end() &&
|
||||
active_.find(*next) == active_.end()) {
|
||||
sequential_prefetches_.fetch_add(1, std::memory_order_relaxed);
|
||||
create_cached_block(*next, std::promise<block_range>{}, 0,
|
||||
std::numeric_limits<size_t>::max());
|
||||
|
Loading…
x
Reference in New Issue
Block a user