diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-14 20:24:08 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-14 20:24:08 (GMT) |
commit | 31ff357f3190a869147378a9a136510be2caafd7 (patch) | |
tree | 5220b17a8e4b6c434b799108719a1dc15d6c0326 /src/H5A.c | |
parent | 1726061075e9adc99ac2286fb542438acc79c4ab (diff) | |
download | hdf5-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.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -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) { |