From d43e6115b673fe03cf9272a6c74af0c41177fef9 Mon Sep 17 00:00:00 2001 From: wollman Date: Tue, 24 Mar 1998 18:06:34 +0000 Subject: Use the zone allocator to allocate inpcbs and tcpcbs. Each protocol creates its own zone; this is used particularly by TCP which allocates both inpcb and tcpcb in a single allocation. (Some hackery ensures that the tcpcb is reasonably aligned.) Also keep track of the number of pcbs of each type allocated, and keep a generation count (instance version number) for future use. --- sys/netinet/raw_ip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/netinet/raw_ip.c') diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 95f364e..a8103ff 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ip.c,v 1.50 1997/12/18 09:13:39 davidg Exp $ + * $Id: raw_ip.c,v 1.51 1998/01/27 09:15:07 davidg Exp $ */ #include @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,8 @@ rip_init() */ ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask); ripcbinfo.porthashbase = hashinit(1, M_PCB, &ripcbinfo.porthashmask); + ripcbinfo.ipi_zone = zinit("ripcb", sizeof(struct inpcb), + nmbclusters/4, ZONE_INTERRUPT, 0); } static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET }; -- cgit v1.1