summaryrefslogtreecommitdiffstats
path: root/src/H5MP.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-14 03:58:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-14 03:58:59 (GMT)
commit102337449220dfc29be1cce29147704b9c760832 (patch)
tree2f57d117f2bd934eac2768be18dcc866619f390f /src/H5MP.c
parentf16361d5f1dc70c344d8143270aa4aeaa867f244 (diff)
downloadhdf5-102337449220dfc29be1cce29147704b9c760832.zip
hdf5-102337449220dfc29be1cce29147704b9c760832.tar.gz
hdf5-102337449220dfc29be1cce29147704b9c760832.tar.bz2
[svn-r27768] Description:
Complete revamp of package initialization/shutdown mechanism in the library. Each package now has a single init/term routine. This new way should avoid packages being re-initialized during library shutdown and is also be _much_ more proactive about giving feedback for resource leaks internal to the library. Introduces a new "module" header file for packages in the library (e.g src/H5Fmodule.h) which sets up some necessary package configuration macros for the FUNC_ENTER/LEAVE macros. (The VFL drivers have their own slightly modified version of this header, src/H5FDdrvr_module.h) Also cleaned up a bunch of resources leaks all across the library and tests, along with addressing many warnings, as I encountered them. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel Linux/64 3.10.x (kituo) w/serial & parallel Linux/64 2.6.x (ostrich) w/serial
Diffstat (limited to 'src/H5MP.c')
-rw-r--r--src/H5MP.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/H5MP.c b/src/H5MP.c
index 4820b76..50fc598 100644
--- a/src/H5MP.c
+++ b/src/H5MP.c
@@ -29,7 +29,7 @@
*-------------------------------------------------------------------------
*/
-#define H5MP_PACKAGE /*suppress error about including H5MPpkg */
+#include "H5MPmodule.h" /* This source code file is part of the H5MP module */
/* Private headers */
#include "H5private.h" /* Generic Functions */
@@ -63,6 +63,9 @@
/* Package Variable Definitions */
/********************************/
+/* Package initialization variable */
+hbool_t H5_PKG_INIT_VAR = FALSE;
+
/********************/
/* Static Variables */
@@ -90,7 +93,7 @@ H5MP_pool_t *
H5MP_create(size_t page_size, unsigned flags)
{
H5MP_pool_t *mp = NULL; /* New memory pool header */
- H5MP_pool_t *ret_value; /* Return value */
+ H5MP_pool_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -141,7 +144,7 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size)
{
H5MP_page_t *new_page; /* New page created */
H5MP_page_blk_t *first_blk; /* Pointer to first block in page */
- H5MP_page_t *ret_value; /* Return value */
+ H5MP_page_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -212,7 +215,7 @@ H5MP_malloc (H5MP_pool_t *mp, size_t request)
H5MP_page_t *alloc_page = NULL; /* Page to allocate space from */
H5MP_page_blk_t *alloc_free; /* Pointer to free space in page */
size_t needed; /* Size requested, plus block header and alignment */
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)