summaryrefslogtreecommitdiffstats
path: root/src/H5HFcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-08-19 02:42:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-08-19 02:42:18 (GMT)
commit5a7ef381b26985886a88ad88b2afda703b578d24 (patch)
tree55b1938c7711683b77c10dfd296c5e518437f4eb /src/H5HFcache.c
parentc83c6dd945d44cdf9de44087c4063876ab378ac1 (diff)
downloadhdf5-5a7ef381b26985886a88ad88b2afda703b578d24.zip
hdf5-5a7ef381b26985886a88ad88b2afda703b578d24.tar.gz
hdf5-5a7ef381b26985886a88ad88b2afda703b578d24.tar.bz2
[svn-r12598] Description:
- Migrate "direct block location" routine from H5HFman.c to H5HFdblock.c, which is a more appropriate location - Optimize performance of heap code by taking advantage of pinned indirect blocks and use them without putting a metadata cache protect/unprotect pair around them. - Other minor compiler warning cleanups and optimizations... Tested On: FreeBSD/32 4.11 (sleipnir) Linux/64 2.4 (mir) Solaris/64 2.9 (shanti)
Diffstat (limited to 'src/H5HFcache.c')
-rw-r--r--src/H5HFcache.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 63e4e46..e0b0c16 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -1164,6 +1164,20 @@ HDfprintf(stderr, "%s: iblock->ents[%Zu] = {%a}\n", FUNC, u, iblock->ents[u].add
#endif /* QAK */
} /* end for */
+ /* Check if we have any indirect block children */
+ if(iblock->nrows > hdr->man_dtable.max_direct_rows) {
+ unsigned indir_rows; /* Number of indirect rows in this indirect block */
+
+ /* Compute the number of indirect rows for this indirect block */
+ indir_rows = iblock->nrows - hdr->man_dtable.max_direct_rows;
+
+ /* Allocate & initialize child indirect block pointer array */
+ if(NULL == (iblock->child_iblocks = H5FL_SEQ_CALLOC(H5HF_indirect_ptr_t, (size_t)(indir_rows * hdr->man_dtable.cparam.width))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for block entries")
+ } /* end if */
+ else
+ iblock->child_iblocks = NULL;
+
/* Sanity checks */
HDassert((size_t)(p - buf) == iblock->size);
HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */
@@ -1372,6 +1386,8 @@ HDfprintf(stderr, "%s: Destroying indirect block\n", FUNC);
H5FL_SEQ_FREE(H5HF_indirect_ent_t, iblock->ents);
if(iblock->filt_ents)
H5FL_SEQ_FREE(H5HF_indirect_filt_ent_t, iblock->filt_ents);
+ if(iblock->child_iblocks)
+ H5FL_SEQ_FREE(H5HF_indirect_ptr_t, iblock->child_iblocks);
/* Free fractal heap indirect block info */
H5FL_FREE(H5HF_indirect_t, iblock);