summaryrefslogtreecommitdiffstats
path: root/src/H5SM.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-01-03 14:22:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-01-03 14:22:49 (GMT)
commitf8465bd1243d16783b4df44b40193d8f5137a781 (patch)
treea3b35a03bf709f00ac07d4d5f300eab3baae61ff /src/H5SM.c
parentd4f3d93b8d9188548407453e10df12dc9ba0480f (diff)
downloadhdf5-f8465bd1243d16783b4df44b40193d8f5137a781.zip
hdf5-f8465bd1243d16783b4df44b40193d8f5137a781.tar.gz
hdf5-f8465bd1243d16783b4df44b40193d8f5137a781.tar.bz2
[svn-r28773] Description:
Clear memory for shared message info when "deferring" and using memory checker, so valgrind doesn't whine. Tested on: MacOSX/64 10.11.2 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'src/H5SM.c')
-rw-r--r--src/H5SM.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/H5SM.c b/src/H5SM.c
index 4a562dd..413ad1f 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -1375,11 +1375,23 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
} /* end else */
} /* end else */
- if(found)
+ if(found) {
/* If the message was found, it's shared in the heap (now). Set up a
* shared message so we can mark it as shared.
*/
shared.type = H5O_SHARE_TYPE_SOHM;
+
+#ifdef H5_USING_MEMCHECKER
+ /* Reset the shared message payload if deferring. This doesn't matter
+ * in the long run since the payload will get overwritten when the
+ * non-deferred call to this routine occurs, but it stops memory
+ * checkers like valgrind from whining when the partially initialized
+ * shared message is serialized. -QAK
+ */
+ if(defer)
+ HDmemset(&shared.u, 0, sizeof(shared.u));
+#endif /* H5_USING_MEMCHECKER */
+ } /* end if */
else {
htri_t share_in_ohdr; /* Whether the new message can be shared in another object's header */