mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-15 01:16:23 +03:00
Extract bin->stats.nrequests mutation into bin_stats_nrequests_add
This commit is contained in:
parent
8edd101286
commit
e286fba00a
3 changed files with 46 additions and 3 deletions
|
|
@ -100,6 +100,13 @@ bin_t *bin_choose(tsdn_t *tsdn, arena_t *arena, szind_t binind,
|
|||
unsigned *binshard_p);
|
||||
|
||||
/* Stats. */
|
||||
static inline void
|
||||
bin_stats_nrequests_add(tsdn_t *tsdn, bin_t *bin, uint64_t n) {
|
||||
malloc_mutex_lock(tsdn, &bin->lock);
|
||||
bin->stats.nrequests += n;
|
||||
malloc_mutex_unlock(tsdn, &bin->lock);
|
||||
}
|
||||
|
||||
static inline void
|
||||
bin_stats_merge(tsdn_t *tsdn, bin_stats_data_t *dst_bin_stats, bin_t *bin) {
|
||||
malloc_mutex_lock(tsdn, &bin->lock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue