This is the mail archive of the gdb-patches@sourceware.org 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] comdat types


On Thu, Jun 25, 2009 at 01:28:02PM -0700, Doug Evans wrote:
> > Doug> + ?types_htab = htab_create_alloc_ex (41,
> > Doug> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?hash_type_signature,
> > Doug> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?eq_type_signature,
> > Doug> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?NULL,
> > Doug> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?&objfile->objfile_obstack,
> > Doug> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?hashtab_obstack_allocate,
> > Doug> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?dummy_obstack_deallocate);
> >
> > This is just a side note -- I've seen a few hash tables allocated on
> > obstacks. ?Doesn't resizing the table waste memory?
> 
> IIRC I use the noresize traversal routine.
> It's not ideal, no.

FWIW, 3 of the other 4 hash tables are on the compilation unit
obstack, which is temporary.  The exception is type_hash which I found
to be performance-sensitive (both time and space) and have a pretty
good initial size estimate.  Obstacks are a big win for that sort of
thing.

This one probably fills the same niche, but doesn't have an initial
estimate.  So I'm not sure what I think about keeping it on the
obstack.  If the contents can go on the obstack instead, that's
probably enough.

> > Doug> + ?if (this_cu->from_debug_types)
> > Doug> + ? ?{
> > Doug> + ? ? ?/* ??? How come this is for .debug_types only? ?*/
> > Doug> + ? ? ?this_cu->offset = cu.header.offset;
> > Doug> + ? ? ?this_cu->length = cu.header.length + cu.header.initial_length_size;
> >
> > Daniel has asked before for "no new FIXMEs". ?You can't escape this by
> > spelling it "???" :-)
> 
> Well, that one was an oversight (these patches drag on and my eyes
> tend to glaze over ...).
> While as a general rule I don't disagree, it's kinda odd to see others
> add new functionality with open issues.

Yes, we're (me included) not totally consistent on this - but it's a
sure way to get reviewers to chew on you, as you know :-)

As a general extension to the general rule, "FIXME: Foo doesn't work"
makes me happier than "FIXME: What about foo?".  I particularly don't
like FIXMEs with questions in them; we should know what works and
what doesn't.

-- 
Daniel Jacobowitz
CodeSourcery


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