[RFC/RFA] Per-objfile data mechanism

David Carlton carlton@kealia.com
Tue Aug 12 20:51:00 GMT 2003


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



More information about the Gdb-patches mailing list