This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] space reduction in gdbtypes.h


Michael Elizabeth Chastain <mec@shout.net> writes:

> More space reduction!  This is the last of the low-hanging fruit.
> 
>   before: 90001408
>   after:  87068672
> 
> This is a re-arrangement of 'struct main_type'.
> 
>   struct main_type  52  40
> 
> Testing: native i686-pc-linux-gnu, gcc v2 and v3, dwarf-2 and stabs+.
> Full test suite, not regressions.
> 
> Okay to commit?

Yes, with some minor changes:

- I think it's important that this struct start with something that
  indicates which sort of type it represents.  It's weird to have the
  discriminant buried in the middle.  So leave 'code' the first member
  of the structure, and move the {upper,lower}_bound_type fields up.

- Add a short comment indicating that the {upper,lower}_bound_type
  fields pack better at that location.

It's a shame that one needs to make things less clear (e.g., moving
vptr_fieldno away from vptr_basetype) in order to save space.  I wish
there were some way to tell the compiler, "I don't care about the
in-memory ordering of these fields, just pack them as tightly as you
can."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]