public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: sami wagiaalla <swagiaal@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [patch 2/4] Template Lookup
Date: Mon, 27 Sep 2010 09:27:00 -0000	[thread overview]
Message-ID: <4C9D05EE.50200@redhat.com> (raw)
In-Reply-To: <4C9B6898.1000300@redhat.com>

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

      reply	other threads:[~2010-09-24 20:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 15:29 [patch 2/3] " sami wagiaalla
2010-08-18 21:59 ` Tom Tromey
2010-08-26 19:18   ` sami wagiaalla
2010-09-23 18:43     ` [patch 2/4] " sami wagiaalla
2010-09-27  9:27       ` sami wagiaalla [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C9D05EE.50200@redhat.com \
    --to=swagiaal@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).