Skip to content

Commit

Permalink
update LIRS find function
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyan committed Nov 23, 2024
1 parent 9bdd4dd commit b8308cd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion libCacheSim/cache/eviction/LIRS.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,21 @@ static cache_obj_t *LIRS_find(cache_t *cache, const request_t *req,
obj_q = params->LRU_q->find(params->LRU_q, req, update_cache);

if (update_cache == false) {
return obj_s != NULL ? obj_s : obj_q;
if (obj_s != NULL) {
if (obj_s->LIRS.is_LIR || obj_s->LIRS.in_cache) {
return obj_s;
} else {
return NULL;
}
} else if (obj_q != NULL) {
if (obj_q->LIRS.in_cache) {
return obj_q;
} else {
return NULL;
}
} else {
return NULL;
}
}

// cache_obj_t *res = NULL;
Expand Down

0 comments on commit b8308cd

Please sign in to comment.