This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Problem with libiberty's hash tables


FX wrote:
Hi all,

I've started using libiberty's hashtab in libgfortran for some of my
gfortran work to track memory allocations in the library. I store
custom structures in a hash table, each structure containing a unique
pointer (it is a malloc'ed address) that is used for the hash. When I
traverse the table elements after having inserted a few, I get twice
the number I expect. It's probably a beginner's mistake, and will be
easy to spot, but I haven't managed to understand what I'm doing
wrong.

If you don't need GC and you don't need delete (the latter I can't see from your example), a pointer_map is much easier to use.


Paolo


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