summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2010-07-28 17:31:48 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2010-07-28 17:31:48 (GMT)
commit7e2ed5735a5511dbc063aac546f2679e68dc2bf8 (patch)
tree284c3aa7c5cdfa4d76dca5256e20dd47380797aa
parentb49f46fe152d31066571994eaed392c2a3f31cd7 (diff)
downloadhdf5-7e2ed5735a5511dbc063aac546f2679e68dc2bf8.zip
hdf5-7e2ed5735a5511dbc063aac546f2679e68dc2bf8.tar.gz
hdf5-7e2ed5735a5511dbc063aac546f2679e68dc2bf8.tar.bz2
[svn-r19140] In line 861, there's no need to allocate data buffer or copy the data because the attribute
structure is shared now. Only do an assertion check, instead. Tested the same change for 1.8.5 on jam - simple change.
-rw-r--r--src/H5Oattribute.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index 9f0f189..a1dcdc5 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -849,16 +849,9 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/,
if(NULL == (chk_proxy = H5O_chunk_protect(udata->f, udata->dxpl_id, oh, mesg->chunkno)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk")
- /* Allocate storage for the message's data, if necessary */
- if(NULL == ((H5A_t *)mesg->native)->shared->data)
- if(NULL == (((H5A_t *)mesg->native)->shared->data = H5FL_BLK_MALLOC(attr_buf, udata->attr->shared->data_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed")
-
- /* Copy the data into the header message */
- /* (Needs to occur before updating the shared message, or the hash
- * value on the old & new messages will be the same)
- */
- HDmemcpy(((H5A_t *)mesg->native)->shared->data, udata->attr->shared->data, udata->attr->shared->data_size);
+ /* No need to allocate data buffer or copy the data because the structure is shared
+ * now. Only do an assertion check, instead. SLU - 2010/7/28 */
+ HDassert(((H5A_t *)mesg->native)->shared == udata->attr->shared);
/* Mark the message as modified */
mesg->dirty = TRUE;