FreeBSD/sys/kern/subr_vmem.c
/*
 * bt_freehead_toalloc: return the freelist for the given size and allocation
 * strategy.
 *
 * For M_FIRSTFIT, return the list in which any blocks are large enough
 * for the requested size.  otherwise, return the list which can have blocks
 * large enough for the requested size.
 */
return the freelist for the given size and allocation
strategy.

For M_FIRSTFIT, return the list in which any blocks are large enough
for the requested size.  otherwise, return the list which can have blocks
large enough for the requested size.
return the freelist for the given size and allocation strategy . For M_FIRSTFIT return the list in which any blocks are large enough for the requested size . otherwise return the list which can have blocks large enough for the requested size .
static struct vmem_freelist *
bt_freehead_toalloc(vmem_t *vm, vmem_size_t size, int strat)
{
	const vmem_size_t qsize = size >> vm->vm_quantum_shift;
	int idx = SIZE2ORDER(qsize);
	MPASS(size != 0 && qsize != 0);
	MPASS((size & vm->vm_quantum_mask) == 0);
	if (strat == M_FIRSTFIT && ORDER2SIZE(idx) != qsize) {
		idx++;
	}
	MPASS(idx >= 0);
	MPASS(idx < VMEM_MAXORDER);
	return &vm->vm_freelist[idx];
}
static struct vmem_freelist * bt_freehead_toalloc ( vmem_t * vm , vmem_size_t size , int strat ) { const vmem_size_t qsize = size >> vm -> vm_quantum_shift ; int idx = SIZE2ORDER ( qsize ) ; MPASS ( size != 0 && qsize != 0 ) ; MPASS ( ( size & vm -> vm_quantum_mask ) == 0 ) ; if ( strat == M_FIRSTFIT && ORDER2SIZE ( idx ) != qsize ) { idx ++ ; } MPASS ( idx >= 0 ) ; MPASS ( idx < VMEM_MAXORDER ) ; return & vm -> vm_freelist [ idx ] ; }
bt_freehead_toalloc: return the freelist for the given size and allocation
 strategy.
bt_freehead_toalloc : return the freelist for the given size and allocation strategy .
/* check too large request? */