From 53a922e873a17320f442bff6cbea3dc9c5384255 Mon Sep 17 00:00:00 2001 From: harti Date: Tue, 22 Jul 2003 15:11:08 +0000 Subject: Allocate network interfaces from malloc() instead of using a zone. Usually one needs only a couple of them so using a zone is waste of memory (esp. on multi-cpu systems). --- sys/netatm/ipatm/ipatm_if.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/netatm/ipatm') diff --git a/sys/netatm/ipatm/ipatm_if.c b/sys/netatm/ipatm/ipatm_if.c index 08517c5..7f85cde 100644 --- a/sys/netatm/ipatm/ipatm_if.c +++ b/sys/netatm/ipatm/ipatm_if.c @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -58,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include +static MALLOC_DEFINE(M_IPATM_NIF, "ipatm nif", "IP/ATM network interfaces"); + /* * Local functions */ @@ -117,11 +121,7 @@ ipatm_nifstat(cmd, nip, arg) /* * Get a new interface block */ - inp = uma_zalloc(ipatm_nif_zone, M_WAITOK); - if (inp == NULL) { - err = ENOMEM; - break; - } + inp = malloc(sizeof(*inp), M_IPATM_NIF, M_WAITOK | M_ZERO); inp->inf_nif = nip; inp->inf_state = IPNIF_ADDR; inp->inf_arpnotify = ipatm_arpnotify; @@ -161,7 +161,7 @@ ipatm_nifstat(cmd, nip, arg) * Clean up and free block */ UNLINK(inp, struct ip_nif, ipatm_nif_head, inf_next); - uma_zfree(ipatm_nif_zone, inp); + free(inp, M_IPATM_NIF); break; case NCM_SETADDR: -- cgit v1.1