Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Aug 2010 15:19:37 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= <des@des.no>
Cc:        freebsd-hackers@freebsd.org, Ivan Voras <ivoras@freebsd.org>
Subject:   Re: Why is TUNABLE_INT discouraged?
Message-ID:  <AANLkTi=puD%2B-WeZ%2BFGdtZtw1v%2BNnGD_htwNa%2BEn9fcML@mail.gmail.com>
In-Reply-To: <86d3tujh72.fsf@ds4.des.no>
References:  <AANLkTinKaiGFhKRgqQ%2BFjm=02VfWCxULe0a68y-PkJx6@mail.gmail.com> <86fwyq8rsc.fsf@ds4.des.no> <i3kbis$73l$1@dough.gmane.org> <86d3tujh72.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/8/7 Dag-Erling Sm=F8rgrav <des@des.no>:
> Ivan Voras <ivoras@freebsd.org> writes:
>> 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?
>
> Perhaps. =A0I don't remember all the details; I can't find a discussion i=
n
> the list archives (other than me announcing the change in response to a
> bug report), but there must have been one, either on IRC or in Karlsruhe.
> In any case, I never removed TUNABLE_INT(), so...

It does matter for integers on 64-bit vs 32-bit architectures though,
right (feel free to ignore the second i386 value for _limits.h... it
was a hack for gcc according to the comment)?

$ egrep -nr '#define[[:space:]]+__LONG_MAX' amd64/include/
i386/include/ | grep -v svn
amd64/include/_limits.h:63:#define	__LONG_MAX	0x7fffffffffffffffL	/*
max for a long */
i386/include/_limits.h:65:#define	__LONG_MAX	0x7fffffffffffffffL
i386/include/_limits.h:69:#define	__LONG_MAX	0x7fffffffL	/* max value
for a long */

$ egrep -nr '#define[[:space:]]+__INT_MAX' amd64/include/
i386/include/ | grep -v svn
amd64/include/_limits.h:59:#define	__INT_MAX	0x7fffffff	/* max value
for an int */
i386/include/_limits.h:59:#define	__INT_MAX	0x7fffffff	/* max value
for an int */

I was originally asking because I didn't have the background to know
why a TUNABLE_UINT set of macros didn't exist.

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=puD%2B-WeZ%2BFGdtZtw1v%2BNnGD_htwNa%2BEn9fcML>