mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-11 10:10:54 +03:00
PA: Move in decay initialization.
This commit is contained in:
parent
45671e4a27
commit
faec7219b2
3 changed files with 14 additions and 13 deletions
10
src/pa.c
10
src/pa.c
|
|
@ -14,7 +14,8 @@ pa_nactive_sub(pa_shard_t *shard, size_t sub_pages) {
|
|||
|
||||
bool
|
||||
pa_shard_init(tsdn_t *tsdn, pa_shard_t *shard, base_t *base, unsigned ind,
|
||||
pa_shard_stats_t *stats, malloc_mutex_t *stats_mtx) {
|
||||
pa_shard_stats_t *stats, malloc_mutex_t *stats_mtx, nstime_t *cur_time,
|
||||
ssize_t dirty_decay_ms, ssize_t muzzy_decay_ms) {
|
||||
/* This will change eventually, but for now it should hold. */
|
||||
assert(base_ind_get(base) == ind);
|
||||
/*
|
||||
|
|
@ -53,6 +54,13 @@ pa_shard_init(tsdn_t *tsdn, pa_shard_t *shard, base_t *base, unsigned ind,
|
|||
return true;
|
||||
}
|
||||
|
||||
if (decay_init(&shard->decay_dirty, cur_time, dirty_decay_ms)) {
|
||||
return true;
|
||||
}
|
||||
if (decay_init(&shard->decay_muzzy, cur_time, muzzy_decay_ms)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
atomic_store_zu(&shard->extent_sn_next, 0, ATOMIC_RELAXED);
|
||||
atomic_store_zu(&shard->nactive, 0, ATOMIC_RELAXED);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue