diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-25 19:56:18 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-25 19:56:18 (GMT) |
commit | 434643dd4d14a841abdcc73ad7b3a0a8e06e4438 (patch) | |
tree | 24ba05d5c24bc4845bcb5c0051d9fcafbfc5afd6 /src/H5Pint.c | |
parent | f0e0137b6110fb4f0c3ffe40a9bb5d43111874a7 (diff) | |
download | hdf5-434643dd4d14a841abdcc73ad7b3a0a8e06e4438.zip hdf5-434643dd4d14a841abdcc73ad7b3a0a8e06e4438.tar.gz hdf5-434643dd4d14a841abdcc73ad7b3a0a8e06e4438.tar.bz2 |
[svn-r22600] Description:
Bring r22251:22599 from trunk to revise_chunks branch.
Tested on:
Mac OSX/64 10.7.4 (amazon) w/gcc 4.7.1, C++ & FORTRAN
(Not h5committested yet, as this branch doesn't require it)
Diffstat (limited to 'src/H5Pint.c')
-rw-r--r-- | src/H5Pint.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/H5Pint.c b/src/H5Pint.c index 46a06a0..dae7b08 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -38,6 +38,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ + /****************/ /* Local Macros */ /****************/ @@ -236,6 +237,25 @@ H5FL_DEFINE_STATIC(H5P_genprop_t); /* Declare a free list to manage the H5P_genplist_t struct */ H5FL_DEFINE_STATIC(H5P_genplist_t); +/* Generic Property Class ID class */ +static const H5I_class_t H5I_GENPROPCLS_CLS[1] = {{ + H5I_GENPROP_CLS, /* ID class value */ + 0, /* Class flags */ + 64, /* Minimum hash size for class */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5P_close_class /* Callback routine for closing objects of this class */ +}}; + +/* Generic Property List ID class */ +static const H5I_class_t H5I_GENPROPLST_CLS[1] = {{ + H5I_GENPROP_LST, /* ID class value */ + 0, /* Class flags */ + 128, /* Minimum hash size for class */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5P_close /* Callback routine for closing objects of this class */ +}}; + + /*-------------------------------------------------------------------------- NAME @@ -357,9 +377,9 @@ H5P_init_interface(void) /* * Initialize the Generic Property class & object groups. */ - if(H5I_register_type(H5I_GENPROP_CLS, (size_t)H5I_GENPROPCLS_HASHSIZE, 0, (H5I_free_t)H5P_close_class) < 0) + if(H5I_register_type(H5I_GENPROPCLS_CLS) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group") - if(H5I_register_type(H5I_GENPROP_LST, (size_t)H5I_GENPROPOBJ_HASHSIZE, 0, (H5I_free_t)H5P_close) < 0) + if(H5I_register_type(H5I_GENPROPLST_CLS) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group") /* Repeatedly pass over the list of property list classes for the library, @@ -2314,9 +2334,13 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, /* Check if the property has been deleted */ if(NULL != H5SL_search(plist->del, name)) { + char *temp_name = NULL; /* Remove the property name from the deleted property skip list */ - if(NULL == H5SL_remove(plist->del, name)) + if(NULL == (temp_name = H5SL_remove(plist->del, name))) HGOTO_ERROR(H5E_PLIST,H5E_CANTDELETE,FAIL,"can't remove property from deleted skip list") + + /* free the name of the removed property */ + H5MM_xfree(temp_name); } /* end if */ else { H5P_genclass_t *tclass; /* Temporary class pointer */ |