linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH 1/2] Add new streams to a hash-list based on their names
Date: Tue, 19 Apr 2011 15:01:48 -0700	[thread overview]
Message-ID: <BANLkTim28ODvCB541rzmvXVgByF5h-ZAMQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1104191113010.22048@i5.linux-foundation.org>

On Tue, Apr 19, 2011 at 11:17 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> +       while ((c = *name++) != 0)
> +               hash = (hash + (c << 4) + (c >> 4)) * 11;
> +
> +       hash *= HASH_PRIME;
> +       hash >>= 32 - HASHED_INPUT_BITS;

Just curious about this hash function, obviously it is not the same as the one
used for hashing idents. Does it have any history or you just code it up?

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-04-19 22:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 18:12 [PATCH 0/2] Fix 'already_tokenized()' performance problem Linus Torvalds
2011-04-19 18:17 ` [PATCH 1/2] Add new streams to a hash-list based on their names Linus Torvalds
2011-04-19 22:01   ` Christopher Li [this message]
2011-04-19 22:13     ` Linus Torvalds
2011-04-19 18:19 ` PATCH 2/2] Teach 'already_tokenized()' to use the stream name hash table Linus Torvalds
2011-04-19 21:52 ` [PATCH 0/2] Fix 'already_tokenized()' performance problem Christopher Li
2011-04-19 22:09   ` Linus Torvalds

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=BANLkTim28ODvCB541rzmvXVgByF5h-ZAMQ@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 NNTP newsgroup(s).