summaryrefslogtreecommitdiffstats
path: root/src/H5Aprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1997-10-08 20:37:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1997-10-08 20:37:02 (GMT)
commit25b702e2bed191bcba75dd715863e94f926e70ea (patch)
tree2f862b86e505224ed7cecba431f57f9f0581a6cc /src/H5Aprivate.h
parent5f027262a5ffd1549c50e609e3947c7f225cc63e (diff)
downloadhdf5-25b702e2bed191bcba75dd715863e94f926e70ea.zip
hdf5-25b702e2bed191bcba75dd715863e94f926e70ea.tar.gz
hdf5-25b702e2bed191bcba75dd715863e94f926e70ea.tar.bz2
[svn-r113] Added mechanism for reference counting IDs. This is to facilitate sharing
an ID between multiple interfaces in memory. Changes included adding a parameter to the H5Ainit_group call for the function to call to free the structure associated with an ID when its reference count drops to zero and two new function calls: H5Ainc_ref & H5Adec_ref which increment and decrement the reference count of IDs. Its still possible to call H5Aremove_atom on a ID with multiple references, leaving dangling IDs in memory...
Diffstat (limited to 'src/H5Aprivate.h')
-rw-r--r--src/H5Aprivate.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h
index 97b8688..38a7512 100644
--- a/src/H5Aprivate.h
+++ b/src/H5Aprivate.h
@@ -67,7 +67,8 @@
/* Atom information structure used */
typedef struct atom_info_struct_tag {
- hid_t id; /* atom ID for this info */
+ hid_t id; /* atom ID for this info */
+ uintn count; /* ref. count for this atom */
VOIDP *obj_ptr; /* pointer associated with the atom */
struct atom_info_struct_tag *next; /* link to next atom (in case of hash-clash) */
}atom_info_t;
@@ -80,9 +81,9 @@ typedef struct atom_group_struct_tag {
intn hash_size; /* size of the hash table to store the atoms in */
uintn atoms; /* current number of atoms held */
uintn nextid; /* atom ID to use for the next atom */
+ void (*free_func)(void *); /* Pointer to function to call when releasing ref counted object */
atom_info_t **atom_list;/* pointer to an array of ptrs to atoms */
}atom_group_t;
-
#endif