Re: [PATCH] libxtables: Dont initialize global xt_params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 2009-02-12 16:09, Thomas Jarosch wrote:
>> -struct xtables_globals *xt_params = NULL;
>> +struct xtables_globals *xt_params;
>
>Thanks for your patch. Did you know about zeroing of .bss before?
>
>I see two possible drawbacks using this style:
>
>1. Other people which don't know this "trick" will think
>the variable is not initialized -> Hard to read.

Well, maybe then they should get a better C book --
automatic initialization is said to be(*) part of the C standard.
And one should know the standard of a language IMHO.

(*) Because it is not free, it remains a saga from people who do
have access to it. :p

>2. If that variable gets moved f.e. inside a function, it will become 
>uninitialized. Also I'm not sure if the savings are even measurable...

It seems to be for the Linux kernel. Especially when you happen
to have large globals (both a lot of them, and large; e.g.
foo[NR_CUPS]) this becomes a concern.


Just my 2 ints. (Oh wait, move them to bss!)

>
>Just my two cents
>Thomas
>

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux