libiberty: hashtab allocation functions with an extra argument

DJ Delorie dj@redhat.com
Wed Jan 15 00:24:00 GMT 2003


> I suppose I can.  We try hard to avoid that; there's a separate value
> of the argument per objfile, and it's a long-term design goal to have
> most of GDB run as a library and use no global state (re-entrancy).

Sorry, I meant file-scope global, not program-scope global.  The
function that loads the symbols into the hash table can set a
file-global pointer, and specify alloc functions that exist in the
same file, so they can access that pointer.

You do realize that all the function pointers in htab won't be usable
if you mmap the struct, yes?  (because you don't know which version of
gdb it goes with)



More information about the Gcc-patches mailing list