Re: [PATCH] Have partial symbol tables own psymbol vectors

Simon Marchi
2020-09-01T14:30:49Z

On 2020-09-01 10:20 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
> Simon> On 2020-08-31 1:09 p.m., Tom Tromey wrote:
>>> The main drawback of this patch is that it increases the size of
>>> partial symtab.
>
> Simon> Regarding this: it seems to me like in the end, no more memory is used (even when
> Simon> sharing partial symtabs between objfiles), it's just moved around, is that right?
> Simon> If so, I don't understand why you say it's a "drawback", doesn't it make it sound
> Simon> a bit scarier than it actually is?
>
> No, a bit more memory is used.
>
> Right now there are 2 std::vector<>s used for globals and static. (And
> there is a pair used to track the vectors being updated.)
>
> Each partial symtab currently has integer indexes into these vectors.
>
> After the patch, the vectors are removed from the psymtab storage (this
> is per-objfile, so IMO negligible), but now each partial symtab holds
> two vectors. On my machine (x86-64 with GNU libstdc++), a std::vector<>
> is 24 bytes. So, we're going from 4*sizeof(int) == 16 bytes per partial
> symtab to 48 bytes per.

Ok, I see. I don't think that's a problem.

Simon