diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-14 22:26:14 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-15 13:09:50 (GMT) |
commit | 7705120f1e627ce60274225720e06d18a7062e85 (patch) | |
tree | d922eb33eca374d610475fd684b78593bafb6449 /src/H5HFiblock.c | |
parent | 6f7605774874356b87b2d0fd9b15f1da7de8ef97 (diff) | |
download | hdf5-7705120f1e627ce60274225720e06d18a7062e85.zip hdf5-7705120f1e627ce60274225720e06d18a7062e85.tar.gz hdf5-7705120f1e627ce60274225720e06d18a7062e85.tar.bz2 |
More merges from 1.10 comments and inits
Diffstat (limited to 'src/H5HFiblock.c')
-rw-r--r-- | src/H5HFiblock.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index e613cab..394c44e 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -558,20 +558,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if (!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) { - /* Currently, the old block data is "thrown away" after the space is reallocated, - * to avoid data copy in H5MF_realloc() call by just free'ing the space and - * allocating new space. - * - * This also keeps the file smaller, by freeing the space and then - * allocating new space, instead of vice versa (in H5MF_realloc). - * - * QAK - 3/14/2006 - */ + if (!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) /* Free previous indirect block disk space */ if (H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") - } /* end if */ /* Compute size of buffer needed for new indirect block */ iblock->nrows = new_nrows; @@ -608,11 +598,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for direct entries") /* Check for skipping over rows and add free section for skipped rows */ - if (skip_direct_rows) { + if (skip_direct_rows) /* Add skipped blocks to heap's free space */ if (H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, (new_next_entry - next_entry)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") - } /* end if */ /* Initialize new direct block entries in rows added */ acc_dblock_free = 0; @@ -728,20 +717,10 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if (!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) { - /* Currently, the old block data is "thrown away" after the space is reallocated, - * to avoid data copy in H5MF_realloc() call by just free'ing the space and - * allocating new space. - * - * This also keeps the file smaller, by freeing the space and then - * allocating new space, instead of vice versa (in H5MF_realloc). - * - * QAK - 6/12/2006 - */ + if (!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) /* Free previous indirect block disk space */ if (H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") - } /* end if */ /* Compute free space in rows to delete */ acc_dblock_free = 0; @@ -1139,7 +1118,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, uns H5HF_parent_t par_info; /* Parent info for loading block */ H5HF_indirect_t *iblock = NULL; /* Indirect block from cache */ hbool_t should_protect = FALSE; /* Whether we should protect the indirect block or not */ - H5HF_indirect_t *ret_value; /* Return value */ + H5HF_indirect_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT |