summaryrefslogtreecommitdiffstats
path: root/src/H5Ipkg.h
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-05-11 02:30:58 (GMT)
committerGitHub <noreply@github.com>2021-05-11 02:30:58 (GMT)
commit53cfafff061071dca0d74617629c66350f66d6cc (patch)
tree7fa76dff874cf0de04b67081f4bd44a993f1ce1c /src/H5Ipkg.h
parent6ff6504b1808bd0bb0b6dc1ba97b683c7abfa8e1 (diff)
downloadhdf5-53cfafff061071dca0d74617629c66350f66d6cc.zip
hdf5-53cfafff061071dca0d74617629c66350f66d6cc.tar.gz
hdf5-53cfafff061071dca0d74617629c66350f66d6cc.tar.bz2
Brings hash table IDs to 1.12 from develop (#638)
* Brings hash table IDs from develop * Fixes free callback in tid.c
Diffstat (limited to 'src/H5Ipkg.h')
-rw-r--r--src/H5Ipkg.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h
index a50c7ad..1bcea26 100644
--- a/src/H5Ipkg.h
+++ b/src/H5Ipkg.h
@@ -29,8 +29,14 @@
/* Get package's private header */
#include "H5Iprivate.h"
-/* Other private headers needed by this file */
-#include "H5SLprivate.h" /* Skip Lists */
+/* uthash is an external, header-only hash table implementation.
+ *
+ * We include the file directly in src/ and #define a few functions
+ * to use our internal memory calls.
+ */
+#define uthash_malloc(sz) H5MM_malloc(sz)
+#define uthash_free(ptr, sz) H5MM_free(ptr) /* Ignoring sz is intentional */
+#include "uthash.h"
/**************************/
/* Package Private Macros */
@@ -67,6 +73,10 @@ typedef struct H5I_id_info_t {
unsigned count; /* Ref. count for this ID */
unsigned app_count; /* Ref. count of application visible IDs */
const void *object; /* Pointer associated with the ID */
+
+ /* Hash table ID fields */
+ hbool_t marked; /* Marked for deletion */
+ UT_hash_handle hh; /* Hash table handle (must be LAST) */
} H5I_id_info_t;
/* Type information structure used */
@@ -76,7 +86,7 @@ typedef struct H5I_type_info_t {
uint64_t id_count; /* Current number of IDs held */
uint64_t nextid; /* ID to use for the next object */
H5I_id_info_t * last_id_info; /* Info for most recent ID looked up */
- H5SL_t * ids; /* Pointer to skip list that stores IDs */
+ H5I_id_info_t * hash_table; /* Hash table pointer for this ID type */
} H5I_type_info_t;
/*****************************/
@@ -86,12 +96,13 @@ typedef struct H5I_type_info_t {
/* Array of pointers to ID types */
H5_DLLVAR H5I_type_info_t *H5I_type_info_array_g[H5I_MAX_NUM_TYPES];
-/* Variable to keep track of the number of types allocated. Its value is the */
-/* next type ID to be handed out, so it is always one greater than the number */
-/* of types. */
-/* Starts at 1 instead of 0 because it makes trace output look nicer. If more */
-/* types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h */
-/* and/or increase size of hid_t */
+/* Variable to keep track of the number of types allocated. Its value is the
+ * next type ID to be handed out, so it is always one greater than the number
+ * of types.
+ * Starts at 1 instead of 0 because it makes trace output look nicer. If more
+ * types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h
+ * and/or increase size of hid_t
+ */
H5_DLLVAR int H5I_next_type_g;
/******************************/