summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-26 04:41:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-26 04:41:48 (GMT)
commit7a07c6cc133e62f5f00e6a4baf214c9011657800 (patch)
tree8f3407f18b78c8b0283f0663fd0ba0a4ee608212 /src/H5FD.c
parent6543e55efad7ded7f5a0e0dc50786c966aea6b98 (diff)
downloadhdf5-7a07c6cc133e62f5f00e6a4baf214c9011657800.zip
hdf5-7a07c6cc133e62f5f00e6a4baf214c9011657800.tar.gz
hdf5-7a07c6cc133e62f5f00e6a4baf214c9011657800.tar.bz2
[svn-r8946] Purpose:
Code cleanup, sorta Description: Added ifdef sections for "H5_USING_PURIFY" in various places in the code, which are designed to reduce the spurious "uninitialized memory read" warnings from purify which are actually OK. Note that this macro will have to be turned on by adding it to the CFLAGS for the build - I didn't think it was important enough to add a configure flag for. Also, the changes in H5HG.c optimize the walks through the objects in a heap to only look at the 'used' entries instead of all the 'allocated' entries. Platforms tested: Solaris 2.7 (arabica) w/purify Not tested by h5committest
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index a5bbd9d..af58337 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -3357,6 +3357,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
/* Reallocate the metadata accumulator buffer */
if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer")
+#ifdef H5_USING_PURIFY
+HDmemset(file->meta_accum+file->accum_size,0,(file->accum_buf_size-file->accum_size));
+#endif /* H5_USING_PURIFY */
} /* end if */
/* Move the existing metadata to the proper location */
@@ -3382,6 +3385,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
/* Reallocate the metadata accumulator buffer */
if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer")
+#ifdef H5_USING_PURIFY
+HDmemset(file->meta_accum+file->accum_size,0,(file->accum_buf_size-file->accum_size));
+#endif /* H5_USING_PURIFY */
} /* end if */
/* Copy the new metadata to the end */
@@ -3414,6 +3420,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
/* Reallocate the metadata accumulator buffer */
if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer")
+#ifdef H5_USING_PURIFY
+HDmemset(file->meta_accum+file->accum_size,0,(file->accum_buf_size-file->accum_size));
+#endif /* H5_USING_PURIFY */
} /* end if */
/* Calculate the proper offset of the existing metadata */
@@ -3445,6 +3454,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
/* Reallocate the metadata accumulator buffer */
if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer")
+#ifdef H5_USING_PURIFY
+HDmemset(file->meta_accum+file->accum_size,0,(file->accum_buf_size-file->accum_size));
+#endif /* H5_USING_PURIFY */
} /* end if */
/* Copy the new metadata to the end */
@@ -3479,6 +3491,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
/* Note the new buffer size */
file->accum_buf_size=size;
+#ifdef H5_USING_PURIFY
+HDmemset(file->meta_accum+file->accum_size,0,(file->accum_buf_size-file->accum_size));
+#endif /* H5_USING_PURIFY */
} /* end if */
else {
/* Check if we should shrink the accumulator buffer */