summaryrefslogtreecommitdiffstats
path: root/src/H5ACprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-04-19 22:19:08 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-04-19 22:19:08 (GMT)
commit59991950113e7850b20bf2f083c405fe95fa8abe (patch)
tree963520c0da8ed0a23f78d6a31e094e5979dd90ea /src/H5ACprivate.h
parent395326672ca315c4c2fea30de233c3a412fb69d9 (diff)
downloadhdf5-59991950113e7850b20bf2f083c405fe95fa8abe.zip
hdf5-59991950113e7850b20bf2f083c405fe95fa8abe.tar.gz
hdf5-59991950113e7850b20bf2f083c405fe95fa8abe.tar.bz2
[svn-r2157] Changed hashing scheme slightly to better spread out the hash values returned.
Diffstat (limited to 'src/H5ACprivate.h')
-rw-r--r--src/H5ACprivate.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 17d9e06..34f8121 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -71,8 +71,11 @@ typedef struct H5AC_class_t {
* cache entry by hashing the object's file address. Each file has its
* own cache, an array of slots.
*/
-#define H5AC_NSLOTS 10330 /*prime number tend to work best */
-#define H5AC_HASH(F,ADDR) H5F_addr_hash(ADDR,(F)->shared->cache->nslots)
+#define H5AC_NSLOTS 10330 /* The library "likes" this number... */
+#define H5AC_HASH_DIVISOR 8 /* Attempt to spread out the hashing */
+ /* This should be the same size as the alignment of */
+ /* of the smallest file format object written to the file. */
+#define H5AC_HASH(F,ADDR) H5F_addr_hash((ADDR/H5AC_HASH_DIVISOR),(F)->shared->cache->nslots)
typedef struct H5AC_prot_t {
const H5AC_class_t *type; /*type of protected thing */