summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-09-19 18:52:45 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-09-19 18:52:45 (GMT)
commit7f99d42583e4ba3d4e6c3e1bb09538db6b42e388 (patch)
treee7c4e39e22cbf18d4d0443b317deab9a21e697e1 /src
parent73bd8b7c2fe0d5c8763cb2d33fe1915e465947cb (diff)
downloadhdf5-7f99d42583e4ba3d4e6c3e1bb09538db6b42e388.zip
hdf5-7f99d42583e4ba3d4e6c3e1bb09538db6b42e388.tar.gz
hdf5-7f99d42583e4ba3d4e6c3e1bb09538db6b42e388.tar.bz2
Reverted H5T code since datatypes will not be supported at
this time.
Diffstat (limited to 'src')
-rw-r--r--src/H5T.c82
-rw-r--r--src/H5Tprivate.h1
2 files changed, 14 insertions, 69 deletions
diff --git a/src/H5T.c b/src/H5T.c
index cc0e782..b2575d5 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1696,95 +1696,41 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Tclose
+ * Function: H5Tclose
*
- * Purpose: Frees a datatype and all associated memory.
+ * Purpose: Frees a datatype and all associated memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
+ *
+ * Modifications:
*
*-------------------------------------------------------------------------
*/
herr_t
H5Tclose(hid_t type_id)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5T_t *dt; /* Pointer to datatype to close */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", type_id);
- /* Call internal function */
- if(H5T_close_id(type_id) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Tclose() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5T_close_id
- *
- * Purpose: Internal function to free a datatype and all associated
- * memory.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Dana Robinson
- * Summer 2016
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5T_close_id(hid_t type_id)
-{
- H5T_t *dt; /* Pointer to datatype to close */
- H5F_t *file = NULL; /* File */
- hbool_t evict = FALSE; /* Evict metadata on close? */
- haddr_t tag = HADDR_UNDEF; /* Metadata tag for evictions */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_STATE_IMMUTABLE == dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype")
-
- /* Check if this is the last object reference and we'll be evicting
- * on close. We need to cache this info since it will be gone after the
- * decrement call frees the struct.
- */
- file = dt->oloc.file;
- if(file && 1 == dt->shared->fo_count && H5F_EVICT_ON_CLOSE(file)) {
- evict = TRUE;
- tag = dt->oloc.addr;
- } /* end if */
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype")
/* When the reference count reaches zero the resources are freed */
if(H5I_dec_app_ref(type_id) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id")
-
- /* Clean up metadata in the metadata cache if evicting on close */
- if(evict && H5F_SHARED(file)) {
-// printf("DUMPING CACHE - BEFORE FLUSH\n");
-// H5AC_dump_cache(file);
- if(H5AC_flush_tagged_metadata(file, tag, H5AC_ind_read_dxpl_id) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
-// printf("DUMPING CACHE - BETWEEN FLUSH AND EVICT\n");
-// H5AC_dump_cache(file);
- if(H5AC_evict_tagged_metadata(file, tag, FALSE, H5AC_ind_read_dxpl_id) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata")
-// printf("DUMPING CACHE - AFTER EVICT\n");
-// H5AC_dump_cache(file);
- } /* end if */
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id")
done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_close_id() */
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Tclose() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index 5fd0cf3..7efcb41 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -108,7 +108,6 @@ H5_DLL herr_t H5T_init(void);
H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable);
H5_DLL herr_t H5T_close(H5T_t *dt);
-H5_DLL herr_t H5T_close_id(hid_t type_id);
H5_DLL H5T_t *H5T_get_super(const H5T_t *dt);
H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal);
H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api);