diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 25 | ||||
-rw-r--r-- | src/H5public.h | 1 |
2 files changed, 26 insertions, 0 deletions
@@ -804,3 +804,28 @@ H5close(void) FUNC_LEAVE_API_NOFS(SUCCEED) } /* end H5close() */ + +/*------------------------------------------------------------------------- + * Function: H5free_memory + * + * Purpose: Frees memory allocated by the library that it is the user's + * responsibility to free. Ensures that the same library + * that was used to allocate the memory frees it. Passing + * NULL pointers is allowed. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5free_memory(void *mem) +{ + FUNC_ENTER_API_NOINIT + H5TRACE1("e", "*x", mem); + + /* At this time, it is impossible for this to fail. */ + HDfree(mem); + + FUNC_LEAVE_API(SUCCEED) +} /* end H5free_memory() */ + diff --git a/src/H5public.h b/src/H5public.h index 39427ed..4f7e7f7 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -334,6 +334,7 @@ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum); H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); +H5_DLL herr_t H5free_memory(void *mem); #ifdef __cplusplus } |