mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-30 16:47:29 +03:00
Fix psset_pick_purge when last candidate with index 0 dirtiness is ineligible
psset_pick_purge used max_bit-- after rejecting a time-ineligible candidate, which caused unnecessary re-scanning of the same bitmap and makes assert fail in debug mode) and a size_t underflow when the lowest-index entry was rejected. Use max_bit = ind - 1 to skip directly past the rejected index.
This commit is contained in:
parent
1d018d8fda
commit
d758349ca4
2 changed files with 58 additions and 2 deletions
|
|
@ -417,7 +417,10 @@ psset_pick_purge(psset_t *psset, const nstime_t *now) {
|
|||
if (nstime_compare(tm_allowed, now) <= 0) {
|
||||
return ps;
|
||||
}
|
||||
max_bit--;
|
||||
if (ind == 0) {
|
||||
break;
|
||||
}
|
||||
max_bit = ind - 1;
|
||||
}
|
||||
/* No page is ready yet */
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue