Resource Management by highfive #789
-
Hello all, I was wondering about resource management by highfive. HDF5 provide H5*close functions that should be called when further manipulation of the (*) entity (i.e. F for File, D for Dataset etc...) are not required (e.g. https://docs.hdfgroup.org/hdf5/v1_12/group___h5_d.html). Do we have to manually call the H5*close functions when working with highfive? I couldn't find anywhere where these are called by highfive. Many thanks for the great work! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, you shouldn't call HighFive works directly on the identifiers and decreases the reference count through |
Beta Was this translation helpful? Give feedback.
No, you shouldn't call
H5*close
. Doing so would almost certainly result in an error.HighFive works directly on the identifiers and decreases the reference count through
H5Idec_ref
(eventually to zero). Looking a some of the implementations ofH5*close
we see that apart from error checking they only callH5I_dec_app_ref
(which is the only function called byH5Idef_ref
). This suggests that decreasing the reference count is sufficient to trigger deallocation of the associated object.