MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / malloc_mutex_prof_read

Function malloc_mutex_prof_read

deps/jemalloc/include/jemalloc/internal/mutex.h:249–264  ·  view source on GitHub ↗

Copy the prof data from mutex for processing. */

Source from the content-addressed store, hash-verified

247
248/* Copy the prof data from mutex for processing. */
249static inline void
250malloc_mutex_prof_read(tsdn_t *tsdn, mutex_prof_data_t *data,
251 malloc_mutex_t *mutex) {
252 mutex_prof_data_t *source = &mutex->prof_data;
253 /* Can only read holding the mutex. */
254 malloc_mutex_assert_owner(tsdn, mutex);
255
256 /*
257 * Not *really* allowed (we shouldn't be doing non-atomic loads of
258 * atomic data), but the mutex protection makes this safe, and writing
259 * a member-for-member copy is tedious for this situation.
260 */
261 *data = *source;
262 /* n_wait_thds is not reported (modified w/o locking). */
263 atomic_store_u32(&data->n_waiting_thds, 0, ATOMIC_RELAXED);
264}
265
266static inline void
267malloc_mutex_prof_accum(tsdn_t *tsdn, mutex_prof_data_t *data,

Callers 2

ctl_refreshFunction · 0.50
arena_stats_mergeFunction · 0.50

Calls 1

Tested by

no test coverage detected