FreeBSD/sys/kern/kern_malloc.c
/*
 * A free operation has occurred -- update malloc type statistics for the
 * amount of the bucket size.  Occurs within a critical section so that the
 * thread isn't preempted and doesn't migrate while updating per-CPU
 * statistics.
 */
A free operation has occurred -- update malloc type statistics for the
amount of the bucket size.  Occurs within a critical section so that the
thread isn't preempted and doesn't migrate while updating per-CPU
statistics.
A free operation has occurred -- update malloc type statistics for the amount of the bucket size . Occurs within a critical section so that the thread isn ' t preempted and doesn ' t migrate while updating per - CPU statistics .
void
malloc_type_freed(struct malloc_type *mtp, unsigned long size)
{
	struct malloc_type_internal *mtip;
	struct malloc_type_stats *mtsp;
	critical_enter();
	mtip = mtp->ks_handle;
	mtsp = &mtip->mti_stats[curcpu];
	mtsp->mts_memfreed += size;
	mtsp->mts_numfrees++;
#ifdef KDTRACE_HOOKS
	if (dtrace_malloc_probe != NULL) {
		uint32_t probe_id = mtip->mti_probes[DTMALLOC_PROBE_FREE];
		if (probe_id != 0)
			(dtrace_malloc_probe)(probe_id,
			    (uintptr_t) mtp, (uintptr_t) mtip,
			    (uintptr_t) mtsp, size, 0);
	}
#endif
	critical_exit();
}
void malloc_type_freed ( struct malloc_type * mtp , unsigned long size ) { struct malloc_type_internal * mtip ; struct malloc_type_stats * mtsp ; critical_enter ( ) ; mtip = mtp -> ks_handle ; mtsp = & mtip -> mti_stats [ curcpu ] ; mtsp -> mts_memfreed += size ; mtsp -> mts_numfrees ++ ; #ifdef KDTRACE_HOOKS if ( dtrace_malloc_probe != NULL ) { uint32_t probe_id = mtip -> mti_probes [ DTMALLOC_PROBE_FREE ] ; if ( probe_id != 0 ) ( dtrace_malloc_probe ) ( probe_id , ( uintptr_t ) mtp , ( uintptr_t ) mtip , ( uintptr_t ) mtsp , size , 0 ) ; } #endif critical_exit ( ) ; }
A free operation has occurred -- update malloc type statistics for the
 amount of the bucket size.
A free operation has occurred -- update malloc type statistics for the amount of the bucket size .