Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha - Mailing list pgsql-hackers

From Kenji T. Hollis
Subject Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha
Date
Msg-id Pine.BSF.3.95.980212100800.28507B-100000@Gawain.Houston-InterWeb.COM
Whole thread Raw
In response to Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Bruce:

> OK, I have a new idea.  See in utils/hash/hashfn.c:tag_hash, there is
> the line:
>
>             for (; keysize > (sizeof(int) - 1); keysize -= sizeof(int),key++)
>                 h = h * PRIME1 ^ (*key);
>
> Now, since h is a long, shouldn't the for loop be comparing
> sizeof(long)?  However, key is an int*.

How is this a problem?  *key is getting the value of the current pointer
of key.  This means, if key contains a string: "Ooga" and key++, then the
value of *key would be "o" in decimal.  This is a standard hashing
routine, and the problem does not lie here as far as I can see.

-- Ken
------
   =========================================================================
      Houston InterWeb Design, Inc.     ||      Office: +1 (713) 627-9494
      Lead Programmer/Designer          ||         Fax: +1 (713) 627-2744
      C++, Windows, and Web Programming ||       Pager: +1 (713) 727-2529
   =========================================================================
               Home page URL: http://www.houston-interweb.com/


pgsql-hackers by date:

Previous
From: "Kenji T. Hollis"
Date:
Subject: Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha
Next
From: "Kenji T. Hollis"
Date:
Subject: Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha