mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-09 23:37:19 +03:00
Introduce lockedint module.
This pulls out the various abstractions where some stats counter is sometimes an atomic, sometimes a plain variable, sometimes always protected by a lock, sometimes protected by reads but not writes, etc. With this change, these cases are treated consistently, and access patterns tagged. In the process, we fix a few missed-update bugs (where one caller assumes "protected-by-a-lock" semantics and another does not).
This commit is contained in:
parent
acd0bf6a26
commit
356aaa7dc6
7 changed files with 341 additions and 290 deletions
|
|
@ -199,7 +199,8 @@ extents_abandon_vm(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||
ecache_t *ecache, edata_t *edata, bool growing_retained) {
|
||||
size_t sz = edata_size_get(edata);
|
||||
if (config_stats) {
|
||||
arena_stats_accum_zu(&arena->pa_shard.stats->abandoned_vm, sz);
|
||||
atomic_fetch_add_zu(&arena->pa_shard.stats->abandoned_vm, sz,
|
||||
ATOMIC_RELAXED);
|
||||
}
|
||||
/*
|
||||
* Leak extent after making sure its pages have already been purged, so
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue