Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Aug 2010 21:18:47 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Why is TUNABLE_INT discouraged?
Message-ID:  <i3kbis$73l$1@dough.gmane.org>
In-Reply-To: <86fwyq8rsc.fsf@ds4.des.no>
References:  <AANLkTinKaiGFhKRgqQ%2BFjm=02VfWCxULe0a68y-PkJx6@mail.gmail.com> <86fwyq8rsc.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7.8.2010 15:40, Dag-Erling Smørgrav wrote:
> Garrett Cooper <gcooper@FreeBSD.org> writes:
>>    I found the commit where it was made (by des@ -- cvs revision
>> 1.120), but unfortunately I lack the context as to why that suggestion
>> is made; the commit isn't very explicit as to why integers tunables
>> should be discouraged
> 
> You're supposed to use TUNABLE_LONG or TUNABLE_ULONG instead.  From
> digging in the -current archives, it seems that the motivation was a bug
> that resulted from using a TUNABLE_INT for a value that was actually an
> address.  It was doubly broken: first because it was too small on 64-bit
> systems, and second because it was signed.

Ok, but still - if the underlying value really is declared as "int",
doesn't it make perfect sense to have something like TUNABLE_INT for it?

Forcing "long" is a bit weird in this context, as C long is 32-bit on
i386 and 64-bit on amd64.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?i3kbis$73l$1>