fatihky / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

experimental libchash.h doesn't function on x64 platforms #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For more than one year, I have been using your libchash library for my own
search engine in tumgazeteler.com news site.
It is a great work, thank you very much.
But, when I migrated to 64 bit, I had problems. Then, I discovered that
LOG_WORD_SIZE query code was wrong.
I just replaced a part of the code in libchash.h :

#ifndef LOG_WORD_SIZE                  /* 5 for 32 bit words, 6 for 64 */
#ifdef __alpha                         /* only way I know of determining */
#define LOG_WORD_SIZE          6       /* log_2(sizeof(ulong)) [in bits] */
#else
#define LOG_WORD_SIZE          5       /* log_2(sizeof(ulong)) [in bits] */
#endif
#endif

with

#if defined (__LP64__) || defined (_LP64)
#define LOG_WORD_SIZE          6       /* log_2(sizeof(ulong)) [in bits] */
#else
#define LOG_WORD_SIZE          5       /* log_2(sizeof(ulong)) [in bits] */
#endif

The code in google code site is still wrong and 64 bit computers are widely
used nowadays. I tought it may be important to fix it.
Thanks again for your great code.

Ismail Kizir

Original issue reported on code.google.com by iki...@gmail.com on 14 Dec 2008 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report!  That fix makes sense.  I'll include it in the next 
sparsehash
release.

I'm glad the experimental C library is working well for you!

Original comment by csilv...@gmail.com on 15 Dec 2008 at 1:22

GoogleCodeExporter commented 9 years ago

Original comment by csilv...@gmail.com on 3 Jan 2009 at 4:29

GoogleCodeExporter commented 9 years ago
This should be fixed in sparsehash 1.4, just released.

Original comment by csilv...@gmail.com on 29 Jan 2009 at 1:41