From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 9 08:02:14 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC1D106566B; Mon, 9 Aug 2010 08:02:14 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DF6E18FC17; Mon, 9 Aug 2010 08:02:13 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id DE1061FFC33; Mon, 9 Aug 2010 08:02:12 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B68BE84528; Mon, 9 Aug 2010 10:02:12 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ivan Voras References: <86fwyq8rsc.fsf@ds4.des.no> <86d3tujh72.fsf@ds4.des.no> <864of680wv.fsf@ds4.des.no> Date: Mon, 09 Aug 2010 10:02:12 +0200 In-Reply-To: (Ivan Voras's message of "Sun, 8 Aug 2010 01:30:19 +0200") Message-ID: <86aaowuscb.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Garrett Cooper Subject: Re: Why is TUNABLE_INT discouraged? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2010 08:02:14 -0000 Ivan Voras writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Not sure what you mean. The original issue was that someone had used > > TUNABLE_INT() for something that was actually a memory address. I > > changed it to TUNABLE_ULONG(). Of course, if your tunable is a boolean > > value or something like maxprocs, an int is fine - but so is a long. > Semantically valid but using TUNABLE_INT to hold pointers is a > developer bug, not the fault of the API, and there's nothing wrong > with "int" as a data type in this context. That's the point. There was no TUNABLE_ULONG() at the time. I added it to fix the bug. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no