FreeBSD/sys/dev/hwpmc/hwpmc_mod.c
/*
 * Base class initializer: allocate structure and set default classes.
 */
Base class initializer: allocate structure and set default classes.
Base class initializer : allocate structure and set default classes .
struct pmc_mdep *
pmc_mdep_alloc(int nclasses)
{
	struct pmc_mdep *md;
	int	n;
	n = 1 + nclasses;
	md = malloc(sizeof(struct pmc_mdep) + n *
	    sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO);
	md->pmd_nclass = n;
	pmc_soft_initialize(md);
	return md;
}
struct pmc_mdep * pmc_mdep_alloc ( int nclasses ) { struct pmc_mdep * md ; int n ; n = 1 + nclasses ; md = malloc ( sizeof ( struct pmc_mdep ) + n * sizeof ( struct pmc_classdep ) , M_PMC , M_WAITOK | M_ZERO ) ; md -> pmd_nclass = n ; pmc_soft_initialize ( md ) ; return md ; }
Base class initializer: allocate structure and set default classes.
Base class initializer : allocate structure and set default classes .
/* SOFT + md classes */ /* Add base class. */