summaryrefslogtreecommitdiffstats
path: root/src/H5VL.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2021-01-27 23:48:31 (GMT)
committerGitHub <noreply@github.com>2021-01-27 23:48:31 (GMT)
commit98a27f1fe4f0cb96ce7fdeee2e95079ae19db5cd (patch)
tree2e0dd2c18e2b05870ea50835e8c7997935ac95a3 /src/H5VL.c
parentdf1d5505c15e27eca9236952bbfef94a6dc8f20d (diff)
downloadhdf5-98a27f1fe4f0cb96ce7fdeee2e95079ae19db5cd.zip
hdf5-98a27f1fe4f0cb96ce7fdeee2e95079ae19db5cd.tar.gz
hdf5-98a27f1fe4f0cb96ce7fdeee2e95079ae19db5cd.tar.bz2
Merge PR #274 to 1.12 Branch (#283)
* Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. * Fix problems with vlens and refs inside compound using H5VLget_file_type() (#274) * Fixed problems with vlens and refs inside compound using H5VLget_file_type() * Fix date in RELEASE.txt * Add assertions * Move some manipulation of H5VL_object_t struct fields into the H5VL package. * Add fix that was mistakenly left off merge commit. * Update src/H5Tprivate.h Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'src/H5VL.c')
-rw-r--r--src/H5VL.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/H5VL.c b/src/H5VL.c
index 92b1e4c..2e63ed9 100644
--- a/src/H5VL.c
+++ b/src/H5VL.c
@@ -704,8 +704,9 @@ H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id)
if (NULL == (dtype = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
- /* Create VOL object for file */
- if (NULL == (file_vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file_obj, connector_id)))
+ /* Create VOL object for file if necessary (force_conv will be TRUE if and
+ * only if file needs to be passed to H5T_set_loc) */
+ if (H5T_GET_FORCE_CONV(dtype) && (NULL == (file_vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, file_obj, connector_id))))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create VOL object")
/* Copy the datatype */
@@ -722,10 +723,12 @@ H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id)
if (H5T_set_loc(file_type, file_vol_obj, H5T_LOC_DISK) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't set datatype location")
- /* file_type now owns file_vol_obj */
- if (H5T_own_vol_obj(file_type, file_vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't give ownership of VOL object")
- file_vol_obj = NULL;
+ /* Release our reference to file_type */
+ if (file_vol_obj) {
+ if (H5VL_free_object(file_vol_obj) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "unable to free VOL object")
+ file_vol_obj = NULL;
+ } /* end if */
/* Set return value */
ret_value = file_type_id;