library/src/utility/BP-GenericFastWeightedBalancer.cc
// creates a new allocated balance structure
creates a new allocated balance structure
creates a new allocated balance structure
P_BP_WEIGHTED_BALANCER BP_CreateNewBalancer()
{
	P_BP_WEIGHTED_BALANCER balancer = (P_BP_WEIGHTED_BALANCER) bpcalloc(sizeof(BP_WEIGHTED_BALANCER), 1);
	if(!balancer)
		return NULL;
	balancer->gc = BP_CreateNewGarbageCollector("balancer garbage collector", 0);
	if(!balancer->gc)
	{
		bpfree(balancer);
		return NULL;
	}
	return balancer;
}
P_BP_WEIGHTED_BALANCER BP_CreateNewBalancer ( ) { P_BP_WEIGHTED_BALANCER balancer = ( P_BP_WEIGHTED_BALANCER ) bpcalloc ( sizeof ( BP_WEIGHTED_BALANCER ) , 1 ) ; if ( ! balancer ) return NULL ; balancer -> gc = BP_CreateNewGarbageCollector ( " " , 0 ) ; if ( ! balancer -> gc ) { bpfree ( balancer ) ; return NULL ; } return balancer ; }
creates a new allocated balance structure
creates a new allocated balance structure
// create new balancer structure // create a new garbage collector // ensure that we have a new collector created for this balancer // return the balancer