Keith Owens <[email protected]> wrote:
>
> Several scheduler macros only read from the task struct, mark them
> const. It can generate better code.
It makes no change to the gcc-3.4.0-compiled x86 kernel's size. Under what
circumstances did you see improvements?
On Tue, 1 Jun 2004 00:16:32 -0700,
Andrew Morton <[email protected]> wrote:
>Keith Owens <[email protected]> wrote:
>>
>> Several scheduler macros only read from the task struct, mark them
>> const. It can generate better code.
>
>It makes no change to the gcc-3.4.0-compiled x86 kernel's size. Under what
>circumstances did you see improvements?
None, it is just good programming practice to mark parameters as const
where possible.
Keith wrote (of some added 'const' qualifiers):
> It can generate better code.
Later, he wrote (when asked under what circumstances he saw this):
>None, it is just good programming practice ...
So you're not saying it _does_ generate better code, but that it's
possible that it could do so, right?
In any case, the value of 'const' to me is more in documenting
the interface, and imposing compiler checked restrictions on the
implementation.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373