mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Define hash_mem in lib/hash.c to apply hash_long to an arbitraty piece of memory.
Date: 07 Jan 2003 06:18:42 +0100	[thread overview]
Message-ID: <87znqd8rm5.fsf@student.uni-tuebingen.de> (raw)
In-Reply-To: <15898.24480.346258.361959@notabene.cse.unsw.edu.au>

Neil Brown <neilb@cse.unsw.edu.au> writes:

> +unsigned long hash_mem(void *buf, unsigned int len, unsigned int bits)
> +{
> +	int hash = 0;

Shouldn't that be unsigned long?

BTW, in my experience using a good hash function is usually more
important than using a fast hash function. Especially the use of '^'
here could lead to very bad performance in obscure cases because of
bit canceling.

-- 
	Falk

  reply	other threads:[~2003-01-07  5:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-07  5:03 Neil Brown
2003-01-07  5:18 ` Falk Hueffner [this message]
2003-01-07  5:31 ` Aaron Lehmann
2003-01-07  6:07   ` Neil Brown
2003-01-07  6:44 ` Linus Torvalds
2003-01-07  7:33 ` Jeremy Fitzhardinge
2003-01-07  7:45   ` Linus Torvalds
2003-01-08  0:00     ` Neil Brown

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=87znqd8rm5.fsf@student.uni-tuebingen.de \
    --to=falk.hueffner@student.uni-tuebingen.de \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®