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: [RFC/RFA] Per-objfile data mechanism


On Tue, 12 Aug 2003 16:08:37 -0400, Andrew Cagney <ac131313@redhat.com> said:

> I just converted gdbarch to an obstack and encountered two occasions
> where xmrealloc would have made my life a little easier.  Instead of
> proposing the use of mmalloc (and hence xmrealloc) though, I modified
> the algorithms / structures a little and avoided the problem.

> Is it possible that the same situtation is being encountered here?  A
> growable hash table can be implemented without needing to reclaim
> memory - something more along the lines of a btree?

Sure, I could replace the data structure in question by a different
one which is more obstack-friendly; it would be work, and the
resulting code would initially be less reliable, but it could be done.
But I guess I don't understand why obstacks are supposed to be so
wonderful.  They're useful if you're allocating zillions of small
objects that should all disappear at the same time, but I don't see
the value of trying to fit all of our data structures into them.

David Carlton
carlton@kealia.com


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