diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-30 01:18:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-30 01:18:27 (GMT) |
commit | 26fdccf6cd0325756a9365c86fd373d3eb955095 (patch) | |
tree | 59a4e13d887ac50ef8b3c96e2e556ee9a4338622 /src/H5Odbg.c | |
parent | 85a7a522a5479bcfd36a98bf2648b49a12d03295 (diff) | |
download | hdf5-26fdccf6cd0325756a9365c86fd373d3eb955095.zip hdf5-26fdccf6cd0325756a9365c86fd373d3eb955095.tar.gz hdf5-26fdccf6cd0325756a9365c86fd373d3eb955095.tar.bz2 |
[svn-r13570] Description:
Fix error when eliminating empty chunk from "middle" of list of chunks
for an object header.
Tested on:
Mac OS X/32 10.4.9 (amazon)
Diffstat (limited to 'src/H5Odbg.c')
-rw-r--r-- | src/H5Odbg.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/H5Odbg.c b/src/H5Odbg.c index b4d642b..108ac81 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -94,6 +94,7 @@ H5O_assert(const H5O_t *oh) { H5O_mesg_t *curr_msg; /* Pointer to current message to examine */ H5O_mesg_t *tmp_msg; /* Pointer to temporary message to examine */ + unsigned cont_msgs_found = 0; /* # of continuation messages for object */ size_t meta_space; /* Size of header metadata */ size_t mesg_space; /* Size of message raw data */ size_t free_space; /* Size of free space in header */ @@ -155,8 +156,26 @@ H5O_assert(const H5O_t *oh) /* Accumulate information, based on the type of message */ if(H5O_NULL_ID == curr_msg->type->id) free_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; - else if(H5O_CONT_ID == curr_msg->type->id) + else if(H5O_CONT_ID == curr_msg->type->id) { + H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; + hbool_t found_chunk = FALSE; /* Found a chunk that matches */ + + /* Increment # of continuation messages found */ + cont_msgs_found++; + + /* Sanity check that every continuation message has a matching chunk */ + /* (and only one) */ + for(v = 0; v < oh->nchunks; v++) { + if(H5F_addr_eq(cont->addr, oh->chunk[v].addr) && cont->size == oh->chunk[v].size) { + HDassert(cont->chunkno == v); + HDassert(!found_chunk); + found_chunk = TRUE; + } /* end if */ + } /* end for */ + HDassert(found_chunk); + meta_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + } /* end if */ else { meta_space += H5O_SIZEOF_MSGHDR_OH(oh); mesg_space += curr_msg->raw_size; @@ -184,6 +203,9 @@ H5O_assert(const H5O_t *oh) } /* end for */ } /* end for */ + /* Sanity check that the # of cont. messages is correct for the # of chunks */ + HDassert(oh->nchunks == (cont_msgs_found + 1)); + /* Sanity check that all the bytes are accounted for */ HDassert(hdr_size == (free_space + meta_space + mesg_space + oh->skipped_mesg_size)); |