mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-04 03:04:16 +03:00
Introduce hpdata_t.
Using an edata_t both for hugepages and the allocations within those hugepages was convenient at first, but has outlived its usefulness. Representing hugepages explicitly, with their own data structure, will make future development easier.
This commit is contained in:
parent
4a15008cfb
commit
ca30b5db2b
17 changed files with 414 additions and 405 deletions
18
src/hpdata.c
Normal file
18
src/hpdata.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||
#include "jemalloc/internal/jemalloc_internal_includes.h"
|
||||
|
||||
#include "jemalloc/internal/hpdata.h"
|
||||
|
||||
static int
|
||||
hpdata_age_comp(const hpdata_t *a, const hpdata_t *b) {
|
||||
uint64_t a_age = hpdata_age_get(a);
|
||||
uint64_t b_age = hpdata_age_get(b);
|
||||
/*
|
||||
* hpdata ages are operation counts in the psset; no two should be the
|
||||
* same.
|
||||
*/
|
||||
assert(a_age != b_age);
|
||||
return (a_age > b_age) - (a_age < b_age);
|
||||
}
|
||||
|
||||
ph_gen(, hpdata_age_heap_, hpdata_age_heap_t, hpdata_t, ph_link, hpdata_age_comp)
|
||||
Loading…
Add table
Add a link
Reference in a new issue