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: [patch 2/4] Template Lookup


On 09/23/2010 10:47 AM, sami wagiaalla wrote:
On 08/26/2010 03:17 PM, sami wagiaalla wrote:

Sami> + /* Has a template symbol for this symbol been added already ? */ Sami> + for (iterator = *(listhead); Sami> + iterator != NULL; Sami> + iterator = iterator->next)

I think this means that adding template symbols is O(N^2).
A temporary hash table for recording this info would be better.


Hmm.. I can't think of an elegant way to do this.

I think we can do this, [...]

OK I re-changed my mind.


I was thinking of creating a hash table of entries that look like this:

struct template_hash_entry
{
  /* Key.  */
  char *name;
  struct pending *list;

  /* Value.  */
  struct symbol *template_sym;
};

problem is the list head for the various lists changes every time a new symbol is added. So in conclusion the requested change can not be done without a bit of refactoring.

Thanks,
  Sami


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