Hi Paolo There are two problems with your suggested changes: - It is platform dependent, on some platforms it simply does not work. - It makes the code unreadable. The initial values are not reflected in the source code.
Regards, Lars On Wed, Oct 15, 2008 at 10:22 PM, Blaisorblade <[EMAIL PROTECTED]> wrote: > > Hi all, > I noticed that in some cases you explicitly initialize global > variables to 0 when definining them, like in src/allocation.cc: > int NativeAllocationChecker::allocation_disallowed_ = 0; > > That wastes space in the binary, which would be saved with this simple > change: > > -int NativeAllocationChecker::allocation_disallowed_ = 0; > +int NativeAllocationChecker::allocation_disallowed_; > > In fact, on Linux, assigning 0 causes the variable to be allocated in > the .data section instead of the .bss (blank static storage) section, > which is represented in the binary simply by its size and is cleared > by the program loader before execution. > > Would you accept a patch removing all those occurrences? I know the > saving would be little (I estimate about one 1K, plus maybe a slight > time saving at load time), but such little wastes are forbidden, for > instance, by the coding style of the Linux kernel source tree. > > Regards > > Paolo 'Blaisorblade' Giarrusso > > > --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
