FreeBSD/usr.sbin/pmcstat/pmcpl_calltree.c
/*
 * Grow a sample block to store pmcstat_npmcs PMCs.
 */
Grow a sample block to store pmcstat_npmcs PMCs.
Grow a sample block to store pmcstat_npmcs PMCs .
static void
pmcpl_ct_samples_grow(struct pmcpl_ct_sample *samples)
{
	int npmcs;
	if (pmcstat_npmcs <= samples->npmcs)
                return;
	npmcs = samples->npmcs +
	    max(pmcstat_npmcs - samples->npmcs, PMCPL_CT_GROWSIZE);
	samples->sb = realloc(samples->sb, npmcs * sizeof(unsigned));
	if (samples->sb == NULL)
		errx(EX_SOFTWARE, "ERROR: out of memory");
	bzero((char *)samples->sb + samples->npmcs * sizeof(unsigned),
	    (npmcs - samples->npmcs) * sizeof(unsigned));
	samples->npmcs = npmcs;
}
static void pmcpl_ct_samples_grow ( struct pmcpl_ct_sample * samples ) { int npmcs ; if ( pmcstat_npmcs <= samples -> npmcs ) return ; npmcs = samples -> npmcs + max ( pmcstat_npmcs - samples -> npmcs , PMCPL_CT_GROWSIZE ) ; samples -> sb = realloc ( samples -> sb , npmcs * sizeof ( unsigned ) ) ; if ( samples -> sb == NULL ) errx ( EX_SOFTWARE , " " ) ; bzero ( ( char * ) samples -> sb + samples -> npmcs * sizeof ( unsigned ) , ( npmcs - samples -> npmcs ) * sizeof ( unsigned ) ) ; samples -> npmcs = npmcs ; }
Grow a sample block to store pmcstat_npmcs PMCs.
Grow a sample block to store pmcstat_npmcs PMCs .
/* Enough storage. */