summaryrefslogtreecommitdiffstats
path: root/src/H5SMbtree2.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2007-01-05 18:30:59 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2007-01-05 18:30:59 (GMT)
commit869ed6e043dfc20b6b6dfda6728c3442ef0409be (patch)
tree40f02a44e098e1976075d5a69428202fe16f493d /src/H5SMbtree2.c
parentec1b0dfda6ac7049f1eeb32fbb93ebd92ccfd342 (diff)
downloadhdf5-869ed6e043dfc20b6b6dfda6728c3442ef0409be.zip
hdf5-869ed6e043dfc20b6b6dfda6728c3442ef0409be.tar.gz
hdf5-869ed6e043dfc20b6b6dfda6728c3442ef0409be.tar.bz2
[svn-r13113] Refactoring. Cleaned up code, added a few sanity checks.
Extracted duplicated code into functions. Tested on Windows, juniper, and kagiso. Will test on copper next.
Diffstat (limited to 'src/H5SMbtree2.c')
-rwxr-xr-xsrc/H5SMbtree2.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c
index adfcaba..1b929e7 100755
--- a/src/H5SMbtree2.c
+++ b/src/H5SMbtree2.c
@@ -93,6 +93,12 @@ H5SM_message_compare(const void *rec1, const void *rec2)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_message_compare)
+ /* JAMES: might be able to spare a sentinel byte instead of worrying about
+ * refcounts. Here, we need to find a deleted message in a B-tree to
+ * actually delete it.
+ */
+ /* JAMES HDassert(mesg->ref_count > 0); */
+
hash_diff = key->hash;
hash_diff -= mesg->hash;
@@ -383,11 +389,12 @@ H5SM_convert_to_list_op(const void * record, void *op_data)
HDassert(op_data);
/* Insert this message into the list */
- for(x=0; x<list->header->list_to_btree; x++)
+ for(x=0; x<list->header->list_max; x++)
{
- if(list->messages[x].hash == H5O_HASH_UNDEF) /* JAMES: is this a valid test? */
+ if(list->messages[x].ref_count == 0)
{
HDmemcpy(&(list->messages[x]), message, sizeof(H5SM_sohm_t));
+ HDassert(list->messages[x].ref_count > 0);
break;
}
}