summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-05-14 20:24:08 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-05-14 20:24:08 (GMT)
commit31ff357f3190a869147378a9a136510be2caafd7 (patch)
tree5220b17a8e4b6c434b799108719a1dc15d6c0326 /src/H5A.c
parent1726061075e9adc99ac2286fb542438acc79c4ab (diff)
downloadhdf5-31ff357f3190a869147378a9a136510be2caafd7.zip
hdf5-31ff357f3190a869147378a9a136510be2caafd7.tar.gz
hdf5-31ff357f3190a869147378a9a136510be2caafd7.tar.bz2
[svn-r13753] Description:
Check in "unique, but sharable" optimization to ISOHM code, which allows object header messages that are only used in one object to remain in the sole user's header, but migrates messages that are used in more than one header into the ISOHM heap. Tested on: Mac OS X/32 10.4.9 (amazon) FreeBSD/32 6.2 (duty) Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 32061f2..8a74720 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -368,12 +368,11 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
/* Check if any of the pieces should be (or are already) shared in the
* SOHM table
*/
- if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_DTYPE_ID, attr->dt) < 0)
+ if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, H5O_DTYPE_ID, attr->dt, NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share datatype failed")
- if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_SDSPACE_ID, attr->ds) < 0)
+ if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, H5O_SDSPACE_ID, attr->ds, NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share dataspace failed")
-
/* Check whether datatype is committed & increment ref count
* (to maintain ref. count incr/decr similarity with "shared message"
* type of datatype sharing)
@@ -2022,7 +2021,22 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr)
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "unable to copy attribute datatype")
if(NULL == (new_attr->ds = H5S_copy(old_attr->ds, FALSE)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "unable to copy attribute dataspace")
-/* XXX: Copy the object location and group path? -QAK */
+
+#if defined(H5_USING_PURIFY) || !defined(NDEBUG)
+ /* Clear object location */
+ if(H5O_loc_reset(&(new_attr->oloc)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to reset location")
+
+ /* Clear path name */
+ if(H5G_name_reset(&(new_attr->path)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to reset path")
+#endif /* H5_USING_PURIFY */
+
+ /* Copy the object location and group path */
+ if(H5O_loc_copy(&(new_attr->oloc), &(old_attr->oloc), H5_COPY_DEEP) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy object location")
+ if(H5G_name_copy(&(new_attr->path), &(old_attr->path), H5_COPY_DEEP) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy path")
/* Copy the attribute data, if there is any */
if(old_attr->data) {