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

Function prof_malloc_sample_object

deps/jemalloc/src/prof.c:342–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void
343prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize,
344 prof_tctx_t *tctx) {
345 prof_tctx_set(tsdn, ptr, usize, NULL, tctx);
346
347 /* Get the current time and set this in the extent_t. We'll read this
348 * when free() is called. */
349 nstime_t t = NSTIME_ZERO_INITIALIZER;
350 nstime_update(&t);
351 prof_alloc_time_set(tsdn, ptr, NULL, t);
352
353 malloc_mutex_lock(tsdn, tctx->tdata->lock);
354 tctx->cnts.curobjs++;
355 tctx->cnts.curbytes += usize;
356 if (opt_prof_accum) {
357 tctx->cnts.accumobjs++;
358 tctx->cnts.accumbytes += usize;
359 }
360 tctx->prepared = false;
361 malloc_mutex_unlock(tsdn, tctx->tdata->lock);
362}
363
364static size_t
365prof_log_bt_index(tsd_t *tsd, prof_bt_t *bt) {

Callers 2

prof_mallocFunction · 0.50
prof_reallocFunction · 0.50

Calls 4

prof_alloc_time_setFunction · 0.85
prof_tctx_setFunction · 0.50
malloc_mutex_lockFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected