I have seen a few programs for unix that seem to group a lot of variables into a structure. They will init the variables somewhere near the beginning of the program and then pass a pointer to this structure in nearly every function call.
Why do they do this, instead of, ie.
declare "global_t foo" in main.c, malloc and init in main(),
and then declare "extern global_t foo" in every other file and skip passing the pointer completely?
BTW. I tested this both ways with LCC, and it made absolutely no difference in the size of the .exe. Did the compiler write exactly the same code both ways?