- missing memory release for te and td structure implemented

This commit is contained in:
2010-12-16 15:09:28 +00:00
parent ec8258e902
commit d1f6efa8c0
3 changed files with 27 additions and 5 deletions
+4 -2
View File
@@ -31,14 +31,16 @@ h5priv_free_idlist_items (
return H5_SUCCESS;
}
/*
Allocate new/empty id-list
*/
h5_err_t
h5priv_alloc_idlist (
h5_file_t* const f,
h5_idlist_t** list,
const h5_size_t size
) {
TRY( (*list = h5_alloc (f, NULL, sizeof (**list))) );
memset (*list, 0, sizeof (**list));
TRY( (*list = h5_calloc (f, 1, sizeof (**list))) );
size_t size_in_bytes = size * sizeof ((*list)->items[0]);
TRY( (*list)->items = h5_alloc (f, (*list)->items, size_in_bytes) );
(*list)->size = size;
+12 -2
View File
@@ -80,12 +80,22 @@ compute_elems_of_vertices (
return H5_SUCCESS;
}
static h5_err_t
free_idlist (
h5_file_t * const f,
const void* __list
) {
h5_idlist_t* list = *(h5_idlist_t**)__list;
TRY( h5priv_free_idlist (f, &list) );
return H5_SUCCESS;
}
static inline h5_err_t
release_te (
h5_file_t* const f
) {
UNUSED_ARGUMENT (f);
// TODO
TRY( h5priv_hwalk (f, &f->t->adjacencies.te_hash, free_idlist) );
return H5_SUCCESS;
}
@@ -118,7 +128,7 @@ release_td (
h5_file_t* const f
) {
UNUSED_ARGUMENT (f);
// TODO
TRY( h5priv_hwalk (f, &f->t->adjacencies.td_hash, free_idlist) );
return H5_SUCCESS;
}
+11 -1
View File
@@ -82,12 +82,22 @@ compute_elems_of_vertices (
return H5_SUCCESS;
}
static h5_err_t
free_idlist (
h5_file_t * const f,
const void* __list
) {
h5_idlist_t* list = *(h5_idlist_t**)__list;
TRY( h5priv_free_idlist (f, &list) );
return H5_SUCCESS;
}
static inline h5_err_t
release_te (
h5_file_t* const f
) {
UNUSED_ARGUMENT (f);
// TODO
TRY( h5priv_hwalk (f, &f->t->adjacencies.te_hash, free_idlist) );
return H5_SUCCESS;
}