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

Function prof_free_sampled_object

deps/jemalloc/src/prof.c:520–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520void
521prof_free_sampled_object(tsd_t *tsd, const void *ptr, size_t usize,
522 prof_tctx_t *tctx) {
523 malloc_mutex_lock(tsd_tsdn(tsd), tctx->tdata->lock);
524
525 assert(tctx->cnts.curobjs > 0);
526 assert(tctx->cnts.curbytes >= usize);
527 tctx->cnts.curobjs--;
528 tctx->cnts.curbytes -= usize;
529
530 prof_try_log(tsd, ptr, usize, tctx);
531
532 if (prof_tctx_should_destroy(tsd_tsdn(tsd), tctx)) {
533 prof_tctx_destroy(tsd, tctx);
534 } else {
535 malloc_mutex_unlock(tsd_tsdn(tsd), tctx->tdata->lock);
536 }
537}
538
539void
540bt_init(prof_bt_t *bt, void **vec) {

Callers 2

prof_reallocFunction · 0.50
prof_freeFunction · 0.50

Calls 6

prof_try_logFunction · 0.85
prof_tctx_should_destroyFunction · 0.70
prof_tctx_destroyFunction · 0.70
malloc_mutex_lockFunction · 0.50
tsd_tsdnFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected