diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-09-14 03:58:59 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-09-14 03:58:59 (GMT) |
commit | 102337449220dfc29be1cce29147704b9c760832 (patch) | |
tree | 2f57d117f2bd934eac2768be18dcc866619f390f /src/H5HFsection.c | |
parent | f16361d5f1dc70c344d8143270aa4aeaa867f244 (diff) | |
download | hdf5-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/H5HFsection.c')
-rw-r--r-- | src/H5HFsection.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/H5HFsection.c b/src/H5HFsection.c index c997119..070bc3e 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -25,7 +25,8 @@ /* Module Setup */ /****************/ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#include "H5HFmodule.h" /* This source code file is part of the H5HF module */ + /***********/ /* Headers */ @@ -407,8 +408,8 @@ static H5HF_free_section_t * H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state) { - H5HF_free_section_t *new_sect; /* New section */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *new_sect; /* New section */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -489,7 +490,7 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry) { H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -866,7 +867,7 @@ H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5HF_free_section_t *new_sect; /* New section */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1261,7 +1262,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect) { H5HF_free_section_t *sect = NULL; /* 'Row' section created */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1513,7 +1514,7 @@ done: H5HF_indirect_t * H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) { - H5HF_indirect_t *ret_value; /* Return value */ + H5HF_indirect_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1675,7 +1676,7 @@ H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, unsigned *des_flags) { H5HF_hdr_t *hdr; /* Fractal heap header */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2102,7 +2103,7 @@ H5HF_sect_row_debug(const H5FS_section_info_t *_sect, static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) { - hsize_t ret_value; /* Return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2133,7 +2134,7 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect) { - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2242,7 +2243,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2313,7 +2314,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ - H5HF_free_section_t *ret_value; /* Return value */ + H5HF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3945,7 +3946,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned end_entry; /* End entry in indirect block */ unsigned end_row; /* End row in indirect block */ unsigned end_col; /* End column in indirect block */ - H5FS_section_info_t *ret_value; /* Return value */ + H5FS_section_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT |