Date: Mon, 16 Oct 1995 13:01:07 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: matt@lkg.dec.com (Matt Thomas) Cc: julian@freefall.freebsd.org, hackers@freefall.freebsd.org Subject: Re: suggested changes to mbuf routines Message-ID: <199510162001.NAA25213@phaeton.artisoft.com> In-Reply-To: <199510151123.LAA01923@whydos.lkg.dec.com> from "Matt Thomas" at Oct 15, 95 11:21:25 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > > In <199510141119.EAA05158@freefall.freebsd.org> , you wrote: > > I find the method of doing the references as done in Digital UNIX > (aka DEC OSF/1) quite clean. Basically the m_ext struct gets an > queue entry added. When the extended mbuf is first allocated, the > link queue entry merely points to itself (an empty queue). As more > references are made, their queues get linked together. As references > are removed, their queues get unlinked. > > To see if there is a non-zero reference count, imply see if the queue > entry points to itself. > > > /* description of external storage mapped into mbuf, valid if M_EXT set */ > struct m_ext { > caddr_t ext_buf; /* start of buffer */ > #if __STDC__ > void (*ext_free)(caddr_t, u_long, caddr_t); > #else > void (*ext_free)(); /* free routine if not the usual */ > #endif ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > u_int ext_size; /* size of buffer, for ext_free */ > caddr_t ext_arg; /* additional ext_free argument */ > struct ext_refq { /* reference list */ > struct ext_refq *forw, *back; > } ext_ref; > }; > > #define MCLREFERENCED(m) \ > ((m)->m_ext.ext_ref.forw != &((m)->m_ext.ext_ref)) This, I like. This: > void (*ext_free)(caddr_t, u_long, caddr_t); Should be: > void (*ext_free) __P((caddr_t, u_long, caddr_t)); Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510162001.NAA25213>