mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-29 03:43:06 +03:00
hpdata: Return the number of pages to be purged.
We'll use this in the next commit.
This commit is contained in:
parent
9fd9c876bb
commit
dc886e5608
3 changed files with 13 additions and 5 deletions
|
|
@ -158,7 +158,7 @@ hpdata_unreserve(hpdata_t *hpdata, void *addr, size_t sz) {
|
|||
hpdata_assert_consistent(hpdata);
|
||||
}
|
||||
|
||||
void
|
||||
size_t
|
||||
hpdata_purge_begin(hpdata_t *hpdata, hpdata_purge_state_t *purge_state) {
|
||||
hpdata_assert_consistent(hpdata);
|
||||
/* See the comment in reserve. */
|
||||
|
|
@ -181,10 +181,13 @@ hpdata_purge_begin(hpdata_t *hpdata, hpdata_purge_state_t *purge_state) {
|
|||
hpdata->touched_pages, HUGEPAGE_PAGES);
|
||||
|
||||
/* We purge everything we can. */
|
||||
assert(hpdata->h_ntouched - hpdata->h_nactive == fb_scount(
|
||||
size_t to_purge = hpdata->h_ntouched - hpdata->h_nactive;
|
||||
assert(to_purge == fb_scount(
|
||||
purge_state->to_purge, HUGEPAGE_PAGES, 0, HUGEPAGE_PAGES));
|
||||
|
||||
hpdata_assert_consistent(hpdata);
|
||||
|
||||
return to_purge;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue