From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Berlin <dan@cgsoftware.com>
Cc: Jim Blandy <jimb@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: Rewriting the type system
Date: Tue, 12 Jun 2001 14:03:00 -0000 [thread overview]
Message-ID: <3B2683A7.9020508@cygnus.com> (raw)
In-Reply-To: <87d78aluw6.fsf@cgsoftware.com>
> Hell, the simple bcache change i submitted last year (updating the
> starting constant, fix the indenting) still hasn't
> been reviewed.
This patch?
I'm suprized you didn't take the initiative here and check it in as an
obvious fix.
Andrew
> Index: bcache.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/bcache.c,v
> retrieving revision 1.4
> diff -c -3 -p -r1.4 bcache.c
> *** bcache.c 2000/06/05 20:49:53 1.4
> --- bcache.c 2000/12/08 05:01:18
> ***************
> *** 28,51 ****
> #include "bcache.h"
> #include "gdb_string.h" /* For memcpy declaration */
>
> ! /* The old hash function was stolen from SDBM. This is what DB 3.0 uses now,
> * and is better than the old one.
> */
> \f
> unsigned long
> hash(void *addr, int length)
> {
> ! const unsigned char *k, *e;
> ! unsigned long h;
> !
> ! k = (const unsigned char *)addr;
> ! e = k+length;
> ! for (h=0; k< e;++k)
> ! {
> ! h *=16777619;
> ! h ^= *k;
> ! }
> ! return (h);
> }
> \f
> /* Growing the bcache's hash table. */
> --- 28,55 ----
> #include "bcache.h"
> #include "gdb_string.h" /* For memcpy declaration */
>
> ! /* The old hash function was stolen from SDBM. This is what DB 3.1 uses now,
> * and is better than the old one.
> + * It's the Foller/Noll/Vo hash code, for those who care.
> */
> + #define FNV0_32_INIT (0) /* To use FNV-0, not recommended */
> + #define FNV1_32_INIT (0x811c9dc5)
> + #define FNV_32_PRIME (0x01000193)
> \f
> unsigned long
> hash(void *addr, int length)
> {
> ! const unsigned char *k, *e;
> ! unsigned long h=FNV1_32_INIT;
> !
> ! k = (const unsigned char *)addr;
> ! e = k+length;
> ! for (; k< e;++k)
> ! {
> ! h *= FNV_32_PRIME;
> ! h ^= *k;
> ! }
> ! return (h);
> }
> \f
> /* Growing the bcache's hash table. */
>
>
>
next prev parent reply other threads:[~2001-06-12 14:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-07 23:22 obvious set_cu_language patch Per Bothner
2001-06-07 23:50 ` Daniel Berlin
2001-06-08 11:01 ` Per Bothner
2001-06-08 14:04 ` Stan Shebs
2001-06-08 14:34 ` Daniel Berlin
2001-06-08 13:04 ` Andrew Cagney
[not found] ` <m2pucevgf6.fsf@kelso.bothner.com>
2001-06-08 13:51 ` Daniel Berlin
[not found] ` <8766e6eke4.fsf@creche.redhat.com>
2001-06-08 14:23 ` Per Bothner
[not found] ` <npelsq28sh.fsf_-_@zwingli.cygnus.com>
2001-06-11 11:43 ` Rewriting the type system Daniel Berlin
2001-06-11 16:58 ` Stan Shebs
2001-06-12 1:44 ` Eli Zaretskii
2001-06-12 9:12 ` Daniel Berlin
2001-06-12 10:01 ` Eli Zaretskii
2001-06-12 10:16 ` Jim Blandy
2001-06-12 10:44 ` Daniel Berlin
2001-06-12 14:02 ` Stan Shebs
2001-06-13 1:45 ` Eli Zaretskii
2001-06-12 11:08 ` Daniel Berlin
2001-06-12 14:03 ` Andrew Cagney [this message]
2001-06-12 21:37 ` Daniel Berlin
2001-06-25 14:13 ` obvious set_cu_language patch Elena Zannoni
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=3B2683A7.9020508@cygnus.com \
--to=ac131313@cygnus.com \
--cc=dan@cgsoftware.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@cygnus.com \
/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