Date: Tue, 5 Dec 2006 16:27:17 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Ade Lovett <ade@FreeBSD.org> Cc: freebsd-scsi@FreeBSD.org, mjacob@FreeBSD.org Subject: Re: a code reduction function addition to cam_xpt Message-ID: <20061205161849.S28896@delplex.bde.org> In-Reply-To: <02408F0C-838D-496A-8BE3-6049C9E77C76@freebsd.org> References: <20061119161631.L44297@ns1.feral.com> <3bbf2fe10611191631h6883b862uf8088533913a7bc6@mail.gmail.com> <20061120221153.GA5155@lor.one-eyed-alien.net> <3bbf2fe10611201418m15d50703m37d9d5620e5c832d@mail.gmail.com> <20061204150922.F18492@ns1.feral.com> <20061205140644.Q28464@delplex.bde.org> <20061204192720.P19791@ns1.feral.com> <ADB526BA-A898-431A-97DA-30DF3ACD7264@FreeBSD.org> <20061204202639.B20246@ns1.feral.com> <02408F0C-838D-496A-8BE3-6049C9E77C76@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 4 Dec 2006, Ade Lovett wrote: > On Dec 04, 2006, at 20:27 , mjacob@freebsd.org wrote: >>> On Dec 04, 2006, at 19:27 , mjacob@freebsd.org wrote: >>>> IOCCC? >>> >>> http://www.ioccc.org/ Or just google it. >>> Consider this another vote for "function" ;) >> >> Bruce is usually less indirect. What gives? You haven't talked to me enough :-). > Multi-line #define's are 'orrible (IMO) -- of course, our tree is littered > with them, but it's highly preferable to have a function over a define, > particularly when it comes to reading the code n months later, trying to > track something down. In this particular case, the minimal overhead of > calling a function rather than having it inline (via #define) is vastly > outweighed by code-readability, and reduction in kernel size. And in many cases reducing the kernel size also reduces time due to it reducing cache misses. Here I think the code is so rarely executed that neither space or time efficiency really matters. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061205161849.S28896>