| 340 | } |
| 341 | |
| 342 | void |
| 343 | prof_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 | |
| 364 | static size_t |
| 365 | prof_log_bt_index(tsd_t *tsd, prof_bt_t *bt) { |
no test coverage detected