Re: [PATCH] libxtables: Dont initialize global xt_params

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

 



Philip Craig wrote:
Thomas Jarosch wrote:
Well, I guess that's a job for the compiler/optimizer. I did a quick test by writing two versions of a small program initializing a static variable with zero and one version that doesn't (=zeroed in .bss). Guess what,
the size of the resulting executable stays the same.

When I initialize the variable with a non-zero value, then the program size increases. I tested "-O2", "-O0" and "-Os" and the results where the same.
Feel free to look at the assembler output, though I guess this optimization
is not measurable and makes the code harder to read :o)

For gcc, this depends on the -fno-zero-initialized-in-bss option.
Recommendations to avoid zero initialization generally come from
a time when gcc didn't do this by default.  Now it is more just
personal preference.

I think the 3.x versions don't do this by default, so as long as they're
supported by the kernel, we should expect people to use them and not
assume defaults of later versions.
--
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