summaryrefslogtreecommitdiffstats
path: root/src/H5SMbtree2.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2007-01-30 20:40:44 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2007-01-30 20:40:44 (GMT)
commit25b96dc712e467b5efe7b166c078e33ed8aef86c (patch)
tree35244758745eded0d0e160e5564f6653194a9c30 /src/H5SMbtree2.c
parent7c733b0afb1b87ddd3314e89b0105b806f6edfb1 (diff)
downloadhdf5-25b96dc712e467b5efe7b166c078e33ed8aef86c.zip
hdf5-25b96dc712e467b5efe7b166c078e33ed8aef86c.tar.gz
hdf5-25b96dc712e467b5efe7b166c078e33ed8aef86c.tar.bz2
[svn-r13224] Fixed a bug where messages would report their "raw size" as the size of a
shared message rather than the full size of the unshared message, which confused some shared message code. Added a test that should make sure that some messages are too small to be written to the deletion test in tsohm.c. Also added a small optimization so that hash values don't need to be calculated on deletes in list indexes. Tested on Windows, smirom, and kagiso.
Diffstat (limited to 'src/H5SMbtree2.c')
-rwxr-xr-xsrc/H5SMbtree2.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c
index f1d12da..908729a 100755
--- a/src/H5SMbtree2.c
+++ b/src/H5SMbtree2.c
@@ -143,14 +143,26 @@ H5SM_message_compare(const void *rec1, const void *rec2)
*/
/* JAMES HDassert(mesg->ref_count > 0); */
+ /* If the key has an fheap ID, we're looking for a message that's
+ * already in the index; if the fheap ID matches, we've found the message
+ * and can stop immediately.
+ * This means that list indexes that don't care about ordering can
+ * pass in bogus hash values and they'll still get a match if the heap
+ * IDs are the same.
+ */
+ if(key->encoding_size == 0)
+ {
+ HDassert(key->encoding == NULL);
+ if(key->message.fheap_id == mesg->fheap_id)
+ HGOTO_DONE(0);
+ }
+
hash_diff = key->message.hash;
hash_diff -= mesg->hash;
/* If the hash values match, make sure the messages are really the same */
if(0 == hash_diff) {
- /* Compare either the heap_ids directly (if the key has one)
- * or the encoded buffers
- */
+ /* Compare the encoded buffers or the fheap IDs */
if(key->encoding_size == 0)
{
HDassert(key->encoding == NULL);
@@ -182,6 +194,7 @@ H5SM_message_compare(const void *rec1, const void *rec2)
ret_value = -1;
}
+done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_message_compare */