mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-23 12:25:50 +03:00
hpdata: Add a test.
We're about to make the functionality here more complicated; testing hpdata directly (rather than relying on user's tests) will make debugging easier.
This commit is contained in:
parent
3ed0b4e8a3
commit
d9f7e6c668
3 changed files with 69 additions and 2 deletions
|
|
@ -112,10 +112,15 @@ hpdata_assert_empty(hpdata_t *hpdata) {
|
|||
assert(hpdata_nfree_get(hpdata) == HUGEPAGE_PAGES);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
hpdata_consistent(hpdata_t *hpdata) {
|
||||
return fb_urange_longest(hpdata->active_pages, HUGEPAGE_PAGES)
|
||||
== hpdata_longest_free_range_get(hpdata);
|
||||
}
|
||||
|
||||
static inline void
|
||||
hpdata_assert_consistent(hpdata_t *hpdata) {
|
||||
assert(fb_urange_longest(hpdata->active_pages, HUGEPAGE_PAGES)
|
||||
== hpdata_longest_free_range_get(hpdata));
|
||||
assert(hpdata_consistent(hpdata));
|
||||
}
|
||||
|
||||
TYPED_LIST(hpdata_list, hpdata_t, ql_link)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue