Re: [PATCH] Autoregulate vm swappiness cleanup

Valdis.Kletnieks
2003-10-28T16:37:18Z

[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]

On Tue, 28 Oct 2003 10:54:56 EST, "Richard B. Johnson" said:

> I keep hearing 'pollutes the global namespace' all the time, now. Do
> you mean that 'C' code designers actually intend to use the same
> name for different procedures or objects in different files?

Right. Exactly.

That's why you need to have module1_debug_level, module2_debug_level,
module3_debug_level and so on, rather than have a 'debug_level' that's visible
in module1, another that's visible in module2, and a third that's visible in
module3. Note that you *CAN* do that if module1, module2, and module3 are all
*single* .c files simply by declaring it 'static int debug_level;'. But if you
decide to splt module1 and module2 into 2 .c files each, suddenly you need to
rename *both* variables....

And I'm *positive* that *nobody* on this list has done that, forgotten to
rename the variables, and then wondered why module1 has 'debug_level = 1;' in
it and the debugging output starts and then mysteriously stops some random time
after (because module2 has 'debug_level = 0;' in it...)

Yes, C does not have a C++ idea of "private data". My point is that quite
often, the use of 'static' to simulate it is the reason for very large .c
files....

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]