FreeBSD/sys/dev/netmap/netmap_monitor.c
/* allocate the monitors array in the monitored kring */
allocate the monitors array in the monitored kring
allocate the monitors array in the monitored kring
static int
nm_monitor_alloc(struct netmap_kring *kring, u_int n)
{
	size_t len;
	struct netmap_kring **nm;
	if (n <= kring->max_monitors)
		return 0;
        len = sizeof(struct netmap_kring *) * n;
	nm = realloc(kring->monitors, len, M_DEVBUF, M_NOWAIT | M_ZERO);
	if (nm == NULL)
		return ENOMEM;
	kring->monitors = nm;
	kring->max_monitors = n;
	return 0;
}
static int nm_monitor_alloc ( struct netmap_kring * kring , u_int n ) { size_t len ; struct netmap_kring * * nm ; if ( n <= kring -> max_monitors ) return 0 ; len = sizeof ( struct netmap_kring * ) * n ; nm = realloc ( kring -> monitors , len , M_DEVBUF , M_NOWAIT | M_ZERO ) ; if ( nm == NULL ) return ENOMEM ; kring -> monitors = nm ; kring -> max_monitors = n ; return 0 ; }
allocate the monitors array in the monitored kring
allocate the monitors array in the monitored kring
/* we already have more entries that requested */