summaryrefslogtreecommitdiffstats
path: root/src/H5HFint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-08-07 19:51:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-08-07 19:51:59 (GMT)
commit4f289e5b9240807d9fa5561fd793981334a9f086 (patch)
tree8a22e083cdab59a3af1577fe5c50f6054b22e958 /src/H5HFint.c
parent80b1c44327f56c2e7edd75389e5b3b5a9b5ea833 (diff)
downloadhdf5-4f289e5b9240807d9fa5561fd793981334a9f086.zip
hdf5-4f289e5b9240807d9fa5561fd793981334a9f086.tar.gz
hdf5-4f289e5b9240807d9fa5561fd793981334a9f086.tar.bz2
[svn-r12551] Description:
Refactor fields in heap header to clean out information from dropped features and also group related fields together more nicely. Add fields to heap header for storing information about "huge" objects. Platforms tested: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago)
Diffstat (limited to 'src/H5HFint.c')
-rw-r--r--src/H5HFint.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/src/H5HFint.c b/src/H5HFint.c
index 9274b4d..ce6d64a 100644
--- a/src/H5HFint.c
+++ b/src/H5HFint.c
@@ -282,6 +282,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sec_node,
{
H5HF_direct_t *dblock = NULL; /* Pointer to direct block to modify */
haddr_t dblock_addr = HADDR_UNDEF; /* Direct block address */
+ size_t blk_off; /* Offset of object within block */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_insert)
@@ -340,36 +341,30 @@ HDfprintf(stderr, "%s: sec_node->u.single.dblock_size = %Zu\n", FUNC, sec_node->
/* Insert object into block */
- /* Check for address mapping type */
- if(hdr->addrmap == H5HF_ABSOLUTE) {
- uint8_t *p; /* Temporary pointer to obj info in block */
- size_t blk_off; /* Offset of object within block */
-
- /* Set the offset of the object within the block */
- blk_off = sec_node->sect_info.addr - dblock->block_off;
+ /* Get the offset of the object within the block */
+ blk_off = sec_node->sect_info.addr - dblock->block_off;
+#ifdef QAK
+HDfprintf(stderr, "%s: blk_off = %Zu\n", FUNC, blk_off);
+#endif /* QAK */
- /* Sanity checks */
+ /* Sanity checks */
#ifdef QAK
HDfprintf(stderr, "%s: hdr->total_man_free = %Hu\n", FUNC, hdr->total_man_free);
HDfprintf(stderr, "%s: dblock->block_off = %Hu\n", FUNC, dblock->block_off);
#endif /* QAK */
- HDassert(sec_node->sect_info.size >= obj_size);
+ HDassert(sec_node->sect_info.size >= obj_size);
-#ifdef QAK
-HDfprintf(stderr, "%s: sec_node->sect_info.size = %Hu\n", FUNC, sec_node->sect_info.size);
-#endif /* QAK */
- /* Reduce (& possibly re-add) single section */
- if(H5HF_sect_single_reduce(hdr, dxpl_id, sec_node, obj_size) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce single section node")
+ /* Reduce (& possibly re-add) single section */
+ if(H5HF_sect_single_reduce(hdr, dxpl_id, sec_node, obj_size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce single section node")
-#ifdef QAK
-HDfprintf(stderr, "%s: blk_off = %Zu\n", FUNC, blk_off);
-#endif /* QAK */
- /* Reduce space available in heap */
- if(H5HF_hdr_adj_free(hdr, -(ssize_t)obj_size) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap")
+ /* Reduce space available in heap */
+ if(H5HF_hdr_adj_free(hdr, -(ssize_t)obj_size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap")
- /* Encode the object in the block */
+ /* Encode the object in the block */
+ {
+ uint8_t *p; /* Temporary pointer to obj info in block */
/* Point to location for object */
p = dblock->blk + blk_off;
@@ -380,19 +375,16 @@ HDfprintf(stderr, "%s: blk_off = %Zu\n", FUNC, blk_off);
/* Sanity check */
HDassert((size_t)(p - (dblock->blk + blk_off)) == obj_size);
+ } /* end block */
- /* Set the heap ID for the new object (heap offset & obj length) */
+ /* Set the heap ID for the new object (heap offset & obj length) */
#ifdef QAK
HDfprintf(stderr, "%s: dblock->block_off = %Hu\n", FUNC, dblock->block_off);
#endif /* QAK */
- H5HF_MAN_ID_ENCODE(id, hdr, (dblock->block_off + blk_off), obj_size);
+ H5HF_MAN_ID_ENCODE(id, hdr, (dblock->block_off + blk_off), obj_size);
#ifdef QAK
HDfprintf(stderr, "%s: obj_off = %Hu, obj_len = %Zu\n", FUNC, (dblock->block_off + blk_off), obj_size);
#endif /* QAK */
- } /* end if */
- else {
-HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "inserting within mapped managed blocks not supported yet")
- } /* end else */
/* Update statistics about heap */
hdr->nobjs++;
@@ -544,7 +536,7 @@ HDfprintf(stderr, "%s: obj_off = %Hu, obj_len = %Zu\n", FUNC, obj_off, obj_len);
HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object offset too large")
if(obj_len > hdr->man_dtable.cparam.max_direct_size)
HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object size too large for direct block")
- if(obj_len > hdr->standalone_size)
+ if(obj_len > hdr->max_man_size)
HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object should be standalone")
/* Check for root direct block */