This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1 of 2] dwarf type unit scaling fix preparatory work
- From: Tom Tromey <tromey at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 04 Jun 2012 14:17:52 -0600
- Subject: Re: [RFA 1 of 2] dwarf type unit scaling fix preparatory work
- References: <20120604072029.AE91F1E1245@ruffy2.mtv.corp.google.com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> It redoes the storage for global_psymbols and static_psymbols.
Doug> Currently they're each one big vector containing every psymtab for
Doug> the entire objfile, and it's hard to add to a psymtab after it's
Doug> created. This patch moves the storage of these objects to the
Doug> psymtab itself.
I think the idea is fine.
Doug> IMO the patch is a clean up in and of itself, it could go in
Doug> absent anything that depends on it.
I agree.
Doug> @@ -153,22 +153,20 @@ struct partial_symtab
[...]
I think the changes to psymtab makes each one use more memory.
I assume this is not too bad in practice, but did you quantify it?
I wonder if psymbol_allocation_list could be moved to psympriv.h now.
IIRC, I only left it where it was since it was used in objfiles.h.
Doug> /* Traverse all psymtabs in one objfile. */
Doug> +/* FIXME: This should be in objfile.h. */
Doug> #define ALL_OBJFILE_PSYMTABS(objfile, p) \
Doug> for ((p) = (objfile) -> psymtabs; (p) != NULL; (p) = (p) -> next)
It is here on purpose -- to help keep psymbol details private.
Only symbol readers, and psymtab.c, should include psympriv.h and know
anything about partial symbols or partial symbol tables.
To this end I put as much as reasonably possible into psympriv.h, to
make the auditing task simpler.
Why do you want to move it?
Doug> + /* Blech. IWBN to use ALL_OBJFILE_PSYMTABS here. */
Why not?
Doug> + /* There's no measurable cost to starting this small, and there is a
Doug> + sufficient space savings for selected testcases. */
Doug> + new_size = 1;
Is this intended to address the space wastage due to doubling the size
of the vector at every allocation?
I wonder if instead we could shrink-wrap psymtabs.
Maybe also copying the lists onto the objfile obstack at the same time.
Doug> + /* Blech. IWBN to use ALL_OBJFILE_PSYMTABS here. */
Why not?
Tom