summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-08-26 14:21:45 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-08-26 14:21:45 (GMT)
commit833839621aac2e39c553b13672b869ba868035f7 (patch)
tree129ca8817f37364c48a202087158da6a0ad5cf3f /src
parent9b934aa767e8c177a0ac84cc808dec9ac49135ae (diff)
downloadhdf5-833839621aac2e39c553b13672b869ba868035f7.zip
hdf5-833839621aac2e39c553b13672b869ba868035f7.tar.gz
hdf5-833839621aac2e39c553b13672b869ba868035f7.tar.bz2
[svn-r1602] Changes since 19990825
---------------------- ./src/H5O.c [1.2, 1.3] Initialzed the padding area between the end of a message and the end of the space allocated for that message. This hopefully fixes an UMR error found by Quincey and prevents the file from containing unwanted data. ./tools/h5ls.c [1.2, 1.3] Fixed a bug where the `Data:' tag didn't get printed for attributes that have more than five values.
Diffstat (limited to 'src')
-rw-r--r--src/H5O.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 20fa016..5a8169d 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1587,14 +1587,18 @@ H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence)
* Aug 7 1997
*
* Modifications:
- *
+ * Robb Matzke, 1999-08-26
+ * If new memory is allocated as a multiple of some alignment
+ * then we're careful to initialize the part of the new memory
+ * from the end of the expected message to the end of the new
+ * memory.
*-------------------------------------------------------------------------
*/
static intn
H5O_alloc_extend_chunk(H5O_t *oh, intn chunkno, size_t size)
{
intn idx, i;
- size_t delta;
+ size_t delta, padding;
uint8_t *old_addr;
FUNC_ENTER(H5O_alloc_extend_chunk, FAIL);
@@ -1659,6 +1663,7 @@ H5O_alloc_extend_chunk(H5O_t *oh, intn chunkno, size_t size)
oh->mesg = x;
}
delta = MAX(H5O_MIN_SIZE, size+H5O_SIZEOF_MSGHDR(f));
+ padding = H5O_ALIGN(delta) - delta;
delta = H5O_ALIGN(delta);
idx = oh->nmesgs++;
oh->mesg[idx].type = H5O_NULL;
@@ -1678,6 +1683,8 @@ H5O_alloc_extend_chunk(H5O_t *oh, intn chunkno, size_t size)
HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed");
}
+ HDmemset(oh->chunk[chunkno].image+oh->chunk[chunkno].size-padding,
+ 0, padding);
/* adjust raw addresses for messages of this chunk */
if (old_addr != oh->chunk[chunkno].image) {