diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 20:43:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 20:43:30 (GMT) |
commit | 1e91d96fa02466ffe451319bdac1005f84dc7993 (patch) | |
tree | 4de04ef502c313dfd766497b20235188761146c0 /src/H5MF.c | |
parent | 95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff) | |
download | hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2 |
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'src/H5MF.c')
-rw-r--r-- | src/H5MF.c | 501 |
1 files changed, 249 insertions, 252 deletions
@@ -49,7 +49,7 @@ #define H5MF_CHECK_FSM(FSM, CF) \ do { \ - HDassert(*CF == FALSE); \ + assert(*CF == FALSE); \ if (!H5F_addr_defined(FSM->addr) || !H5F_addr_defined(FSM->sect_addr)) \ *CF = TRUE; \ } while (0) @@ -146,8 +146,8 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f_sh); - HDassert(f_sh->lf); + assert(f_sh); + assert(f_sh->lf); /* Iterate over all the free space types to determine if sections of that type * can merge with the metadata or small 'raw' data aggregator @@ -200,7 +200,7 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) switch (mapping_type) { case H5MF_AGGR_MERGE_SEPARATE: /* Don't merge any metadata together */ - HDmemset(f_sh->fs_aggr_merge, 0, sizeof(f_sh->fs_aggr_merge)); + memset(f_sh->fs_aggr_merge, 0, sizeof(f_sh->fs_aggr_merge)); /* Check if merging raw data should be allowed */ /* (treat global heaps as raw data) */ @@ -213,7 +213,7 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) case H5MF_AGGR_MERGE_DICHOTOMY: /* Merge all metadata together (but not raw data) */ - HDmemset(f_sh->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f_sh->fs_aggr_merge)); + memset(f_sh->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f_sh->fs_aggr_merge)); /* Allow merging raw data allocations together */ /* (treat global heaps as raw data) */ @@ -223,8 +223,8 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) case H5MF_AGGR_MERGE_TOGETHER: /* Merge all allocation types together */ - HDmemset(f_sh->fs_aggr_merge, (H5F_FS_MERGE_METADATA | H5F_FS_MERGE_RAWDATA), - sizeof(f_sh->fs_aggr_merge)); + memset(f_sh->fs_aggr_merge, (H5F_FS_MERGE_METADATA | H5F_FS_MERGE_RAWDATA), + sizeof(f_sh->fs_aggr_merge)); break; default: @@ -253,8 +253,8 @@ H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f_sh); - HDassert(fs_type); + assert(f_sh); + assert(fs_type); if (H5F_SHARED_PAGED_AGGR(f_sh)) { /* paged aggregation */ if (size >= f_sh->fs_page_size) { @@ -311,16 +311,16 @@ H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ - HDassert(f->shared); - HDassert(H5F_addr_defined(f->shared->fs_addr[type])); - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + assert(f->shared); + assert(H5F_addr_defined(f->shared->fs_addr[type])); + assert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); /* Set up the alignment and threshold to use depending on the manager type */ if (H5F_PAGED_AGGR(f)) { @@ -389,16 +389,16 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ - HDassert(f->shared); - HDassert(!H5F_addr_defined(f->shared->fs_addr[type])); - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + assert(f->shared); + assert(!H5F_addr_defined(f->shared->fs_addr[type])); + assert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); /* Set the free space creation parameters */ fs_create.client = H5FS_CLIENT_FILE_ID; @@ -464,13 +464,13 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ /* Check if the free space manager exists already */ @@ -513,12 +513,12 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert(H5F_addr_defined(f->shared->fs_addr[type])); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert(H5F_addr_defined(f->shared->fs_addr[type])); /* Put address into temporary variable and reset it */ /* (Avoids loopback in file space freeing routine) */ @@ -538,7 +538,7 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) H5AC_set_ring(fsm_ring, &orig_ring); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Before deleting free space manager\n", __func__); + fprintf(stderr, "%s: Before deleting free space manager\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Delete free space manager for this type */ @@ -546,11 +546,11 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); + assert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; /* Sanity check that the free space manager for this type wasn't started up again */ - HDassert(!H5F_addr_defined(f->shared->fs_addr[type])); + assert(!H5F_addr_defined(f->shared->fs_addr[type])); done: /* Reset the ring in the API context */ @@ -583,17 +583,17 @@ H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert(f->shared); - HDassert(f->shared->fs_man[type]); - HDassert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert(f->shared); + assert(f->shared->fs_man[type]); + assert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Before closing free space manager\n", __func__); + fprintf(stderr, "%s: Before closing free space manager\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Close an existing free space structure for the file */ @@ -629,9 +629,9 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(fspace); - HDassert(node); + assert(f); + assert(fspace); + assert(node); H5MF__alloc_to_fs_type(f->shared, alloc_type, node->sect_info.size, &fs_type); @@ -649,10 +649,9 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio H5AC_set_ring(fsm_ring, &orig_ring); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, - "%s: adding node, node->sect_info.addr = %" PRIuHADDR ", node->sect_info.size = %" PRIuHSIZE - "\n", - __func__, node->sect_info.addr, node->sect_info.size); + fprintf(stderr, + "%s: adding node, node->sect_info.addr = %" PRIuHADDR ", node->sect_info.size = %" PRIuHSIZE "\n", + __func__, node->sect_info.addr, node->sect_info.size); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Add the section */ if (H5FS_sect_add(f, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0) @@ -689,8 +688,8 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); /* Set the ring type in the API context */ if (H5MF__fsm_is_self_referential(f->shared, fspace)) @@ -704,13 +703,13 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "error locating free space in file") #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: section found = %d\n", __func__, ret_value); + fprintf(stderr, "%s: section found = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Check for actually finding section */ if (ret_value) { /* Sanity check */ - HDassert(node); + assert(node); /* Retrieve return value */ if (addr) @@ -719,7 +718,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h /* Check for eliminating the section */ if (node->sect_info.size == size) { #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: freeing node\n", __func__); + fprintf(stderr, "%s: freeing node\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Free section node */ @@ -732,8 +731,8 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h node->sect_info.size -= size; #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: re-adding node, node->sect_info.size = %" PRIuHSIZE "\n", __func__, - node->sect_info.size); + fprintf(stderr, "%s: re-adding node, node->sect_info.size = %" PRIuHSIZE "\n", __func__, + node->sect_info.size); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Re-add the section to the free-space manager */ @@ -776,19 +775,19 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: alloc_type = %u, size = %" PRIuHSIZE "\n", __func__, (unsigned)alloc_type, size); + fprintf(stderr, "%s: alloc_type = %u, size = %" PRIuHSIZE "\n", __func__, (unsigned)alloc_type, size); #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Check 1.0\n", __func__); + fprintf(stderr, "%s: Check 1.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Set the ring type in the API context */ @@ -813,7 +812,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* Open the free-space manager */ if (H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space") - HDassert(f->shared->fs_man[fs_type]); + assert(f->shared->fs_man[fs_type]); } /* end if */ /* Search for large enough space in the free space manager */ @@ -825,10 +824,10 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* If no space is found from the free-space manager, continue further action */ if (!H5F_addr_defined(ret_value)) { #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Check 2.0\n", __func__); + fprintf(stderr, "%s: Check 2.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ if (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) { - HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); + assert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); if (HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from paged aggregation") @@ -838,9 +837,9 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") } /* end else */ } /* end if */ - HDassert(H5F_addr_defined(ret_value)); + assert(H5F_addr_defined(ret_value)); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Check 3.0\n", __func__); + fprintf(stderr, "%s: Check 3.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ done: @@ -849,8 +848,8 @@ done: H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving: ret_value = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", __func__, ret_value, - size); + fprintf(stderr, "%s: Leaving: ret_value = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", __func__, ret_value, + size); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP H5MF__sects_dump(f, stderr); @@ -890,7 +889,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) FUNC_ENTER_PACKAGE #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: alloc_type = %u, size = %" PRIuHSIZE "\n", __func__, (unsigned)alloc_type, size); + fprintf(stderr, "%s: alloc_type = %u, size = %" PRIuHSIZE "\n", __func__, (unsigned)alloc_type, size); #endif /* H5MF_ALLOC_DEBUG */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &ptype); @@ -908,7 +907,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* Get the EOA for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") - HDassert(!(eoa % f->shared->fs_page_size)); + assert(!(eoa % f->shared->fs_page_size)); H5MF_EOA_MISALIGN(f, (eoa + size), f->shared->fs_page_size, frag_size); @@ -955,7 +954,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) if (!(f->shared->fs_man[ptype])) if (H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") - HDassert(f->shared->fs_man[ptype]); + assert(f->shared->fs_man[ptype]); if (NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_SMALL, (new_page + size), (f->shared->fs_page_size - size)))) @@ -987,8 +986,8 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) done: #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving: ret_value = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", __func__, ret_value, - size); + fprintf(stderr, "%s: Leaving: ret_value = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", __func__, ret_value, + size); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP H5MF__sects_dump(f, stderr); @@ -1034,14 +1033,14 @@ H5MF_alloc_tmp(H5F_t *f, hsize_t size) FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: size = %" PRIuHSIZE "\n", __func__, size); + fprintf(stderr, "%s: size = %" PRIuHSIZE "\n", __func__, size); #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); /* Retrieve the 'eoa' for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) @@ -1086,15 +1085,15 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", - __func__, (unsigned)alloc_type, addr, size); + fprintf(stderr, "%s: Entering - alloc_type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", + __func__, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); + assert(f); if (!H5F_addr_defined(addr) || 0 == size) HGOTO_DONE(SUCCEED) - HDassert(addr != 0); /* Can't deallocate the superblock :-) */ + assert(addr != 0); /* Can't deallocate the superblock :-) */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -1136,13 +1135,13 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) * space is at the end of the file */ #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: fs_addr = %" PRIuHADDR "\n", __func__, f->shared->fs_addr[fs_type]); + fprintf(stderr, "%s: fs_addr = %" PRIuHADDR "\n", __func__, f->shared->fs_addr[fs_type]); #endif /* H5MF_ALLOC_DEBUG_MORE */ if (!H5F_addr_defined(f->shared->fs_addr[fs_type])) { htri_t status; /* "can absorb" status for section into */ #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Trying to avoid starting up free space manager\n", __func__); + fprintf(stderr, "%s: Trying to avoid starting up free space manager\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Try to shrink the file or absorb the block into a block aggregator */ if ((status = H5MF_try_shrink(f, alloc_type, addr, size)) < 0) @@ -1152,9 +1151,8 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) HGOTO_DONE(SUCCEED) else if (size < f->shared->fs_threshold) { #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, - "%s: dropping addr = %" PRIuHADDR ", size = %" PRIuHSIZE ", on the floor!\n", - __func__, addr, size); + fprintf(stderr, "%s: dropping addr = %" PRIuHADDR ", size = %" PRIuHSIZE ", on the floor!\n", + __func__, addr, size); #endif /* H5MF_ALLOC_DEBUG_MORE */ HGOTO_DONE(SUCCEED) } /* end else-if */ @@ -1171,8 +1169,8 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) */ if (f->shared->fs_state[fs_type] == H5F_FS_STATE_DELETING || !H5F_HAVE_FREE_SPACE_MANAGER(f)) { #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: dropping addr = %" PRIuHADDR ", size = %" PRIuHSIZE ", on the floor!\n", - __func__, addr, size); + fprintf(stderr, "%s: dropping addr = %" PRIuHADDR ", size = %" PRIuHSIZE ", on the floor!\n", + __func__, addr, size); #endif /* H5MF_ALLOC_DEBUG_MORE */ HGOTO_DONE(SUCCEED) } /* end if */ @@ -1192,10 +1190,10 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) /* If size of the freed section is larger than threshold, add it to the free space manager */ if (size >= f->shared->fs_threshold) { - HDassert(f->shared->fs_man[fs_type]); + assert(f->shared->fs_man[fs_type]); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", __func__); + fprintf(stderr, "%s: Before H5FS_sect_add()\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Add to the free space for the file */ @@ -1204,7 +1202,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) node = NULL; #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: After H5FS_sect_add()\n", __func__); + fprintf(stderr, "%s: After H5FS_sect_add()\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ else { @@ -1237,7 +1235,7 @@ done: HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node") #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value); + fprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP H5MF__sects_dump(f, stderr); @@ -1281,15 +1279,15 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, - "%s: Entering: alloc_type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE - ", extra_requested = %" PRIuHSIZE "\n", - __func__, (unsigned)alloc_type, addr, size, extra_requested); + fprintf(stderr, + "%s: Entering: alloc_type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE + ", extra_requested = %" PRIuHSIZE "\n", + __func__, (unsigned)alloc_type, addr, size, extra_requested); #endif /* H5MF_ALLOC_DEBUG */ /* Sanity check */ - HDassert(f); - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(f); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); /* Set mapped type, treating global heap as raw data */ map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type; @@ -1315,7 +1313,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi * page boundary if extended */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa") - HDassert(!(eoa % f->shared->fs_page_size)); + assert(!(eoa % f->shared->fs_page_size)); H5MF_EOA_MISALIGN(f, (eoa + extra_requested), f->shared->fs_page_size, frag_size); } /* end else */ @@ -1336,7 +1334,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi if ((ret_value = H5F__try_extend(f, map_type, end, extra_requested + frag_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: extended = %d\n", __func__, ret_value); + fprintf(stderr, "%s: extended = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* If extending at EOA succeeds: */ @@ -1345,7 +1343,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi H5MF_free_section_t *node = NULL; /* Free space section pointer */ /* Should be large-sized block */ - HDassert(size >= f->shared->fs_page_size); + assert(size >= f->shared->fs_page_size); /* Start up the free-space manager */ if (!(f->shared->fs_man[fs_type])) @@ -1374,7 +1372,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block") #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: H5MF__aggr_try_extend = %d\n", __func__, ret_value); + fprintf(stderr, "%s: H5MF__aggr_try_extend = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ @@ -1400,7 +1398,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending block in free space manager") #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Try to H5FS_sect_try_extend = %d\n", __func__, ret_value); + fprintf(stderr, "%s: Try to H5FS_sect_try_extend = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ @@ -1411,8 +1409,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi if (frag_size <= H5F_PGEND_META_THRES(f) && extra_requested <= frag_size) ret_value = TRUE; #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Try to extend into the page end threshold = %d\n", __func__, - ret_value); + fprintf(stderr, "%s: Try to extend into the page end threshold = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ } /* end if */ @@ -1424,7 +1421,7 @@ done: H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving: ret_value = %d\n", __func__, ret_value); + fprintf(stderr, "%s: Leaving: ret_value = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP H5MF__sects_dump(f, stderr); @@ -1459,20 +1456,20 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", - __func__, (unsigned)alloc_type, addr, size); + fprintf(stderr, "%s: Entering - alloc_type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", + __func__, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(H5F_addr_defined(addr)); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(H5F_addr_defined(addr)); + assert(size > 0); /* Set up free-space section class information */ sect_cls = H5MF_SECT_CLS_TYPE(f, size); - HDassert(sect_cls); + assert(sect_cls); /* Get free space type from allocation type */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -1499,7 +1496,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) if ((ret_value = (*sect_cls->can_shrink)((const H5FS_section_info_t *)node, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check if section can shrink container") if (ret_value > 0) { - HDassert(sect_cls->shrink); + assert(sect_cls->shrink); if ((*sect_cls->shrink)((H5FS_section_info_t **)&node, &udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink container") @@ -1516,7 +1513,7 @@ done: HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node") #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value); + fprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value); #endif /* H5MF_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_try_shrink() */ @@ -1540,12 +1537,12 @@ H5MF_close(H5F_t *f) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering\n", __func__); + fprintf(stderr, "%s: Entering\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) { if ((ret_value = H5MF__close_pagefs(f)) < 0) @@ -1558,7 +1555,7 @@ H5MF_close(H5F_t *f) done: #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving\n", __func__); + fprintf(stderr, "%s: Leaving\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_close() */ @@ -1584,21 +1581,21 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) FUNC_ENTER_PACKAGE #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering\n", __func__); + fprintf(stderr, "%s: Entering\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %" PRIuHADDR "\n", - __func__, (unsigned)type, (void *)f->shared->fs_man[type], (unsigned)type, - f->shared->fs_addr[type]); + fprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %" PRIuHADDR "\n", + __func__, (unsigned)type, (void *)f->shared->fs_man[type], (unsigned)type, + f->shared->fs_addr[type]); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* If the free space manager for this type is open, close it */ @@ -1607,9 +1604,9 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") #ifdef H5MF_ALLOC_DEBUG_MORE - HDfprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %" PRIuHADDR "\n", - __func__, (unsigned)type, (void *)f->shared->fs_man[type], (unsigned)type, - f->shared->fs_addr[type]); + fprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %" PRIuHADDR "\n", + __func__, (unsigned)type, (void *)f->shared->fs_man[type], (unsigned)type, + f->shared->fs_addr[type]); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* If there is free space manager info for this type, delete it */ @@ -1619,7 +1616,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) done: #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving\n", __func__); + fprintf(stderr, "%s: Leaving\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__close_delete() */ @@ -1648,11 +1645,11 @@ H5MF_try_close(H5F_t *f) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering\n", __func__); + fprintf(stderr, "%s: Entering\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); + assert(f); /* If there have been no file space allocations / deallocation so * far, must call H5MF_tidy_self_referential_fsm_hack() to float @@ -1727,7 +1724,7 @@ done: H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving\n", __func__); + fprintf(stderr, "%s: Leaving\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_try_close() */ @@ -1755,14 +1752,14 @@ H5MF__close_aggrfs(H5F_t *f) FUNC_ENTER_PACKAGE #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering\n", __func__); + fprintf(stderr, "%s: Entering\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(f->shared->sblock); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -1789,7 +1786,7 @@ H5MF__close_aggrfs(H5F_t *f) /* superblock extension and free space manager message should * exist at this point -- verify at least the former. */ - HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); + assert(H5F_addr_defined(f->shared->sblock->ext_addr)); /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should @@ -1832,7 +1829,7 @@ H5MF__close_aggrfs(H5F_t *f) curr_ring = needed_ring; } /* end if */ - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); + assert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); if (H5FS_close(f, f->shared->fs_man[type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") @@ -1845,16 +1842,16 @@ H5MF__close_aggrfs(H5F_t *f) /* verify that we haven't dirtied any metadata cache entries * from the metadata free space manager ring out. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* verify that the aggregators are still shutdown. */ - HDassert(f->shared->sdata_aggr.tot_size == 0); - HDassert(f->shared->sdata_aggr.addr == 0); - HDassert(f->shared->sdata_aggr.size == 0); + assert(f->shared->sdata_aggr.tot_size == 0); + assert(f->shared->sdata_aggr.addr == 0); + assert(f->shared->sdata_aggr.size == 0); - HDassert(f->shared->meta_aggr.tot_size == 0); - HDassert(f->shared->meta_aggr.addr == 0); - HDassert(f->shared->meta_aggr.size == 0); + assert(f->shared->meta_aggr.tot_size == 0); + assert(f->shared->meta_aggr.addr == 0); + assert(f->shared->meta_aggr.size == 0); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ @@ -1869,7 +1866,7 @@ H5MF__close_aggrfs(H5F_t *f) * been no file space allocation or deallocation since file * open. */ - HDassert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); + assert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); } /* end if */ else { /* super_vers can be 0, 1, 2 */ for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) @@ -1893,7 +1890,7 @@ done: H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving\n", __func__); + fprintf(stderr, "%s: Leaving\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_aggrfs() */ @@ -1921,16 +1918,16 @@ H5MF__close_pagefs(H5F_t *f) FUNC_ENTER_PACKAGE #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Entering\n", __func__); + fprintf(stderr, "%s: Entering\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(f->shared->sblock); - HDassert(f->shared->fs_page_size); - HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(f->shared->sblock); + assert(f->shared->fs_page_size); + assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -1961,7 +1958,7 @@ H5MF__close_pagefs(H5F_t *f) /* superblock extension and free space manager message should * exist at this point -- verify at least the former. */ - HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); + assert(H5F_addr_defined(f->shared->sblock->ext_addr)); /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should @@ -1998,7 +1995,7 @@ H5MF__close_pagefs(H5F_t *f) curr_ring = needed_ring; } /* end if */ - HDassert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); + assert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); if (H5FS_close(f, f->shared->fs_man[ptype]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") @@ -2011,7 +2008,7 @@ H5MF__close_pagefs(H5F_t *f) /* verify that we haven't dirtied any metadata cache entries * from the metadata free space manager ring out. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ @@ -2038,9 +2035,9 @@ H5MF__close_pagefs(H5F_t *f) * the file driver layer. However, as this possibility seems remote, * it is ignored in the following assert. */ - HDassert((H5F_NULL_FSM_ADDR(f)) || (final_eoa == f->shared->eoa_fsm_fsalloc) || - ((H5F_addr_defined(f->shared->eoa_post_mdci_fsalloc)) && - (final_eoa == f->shared->eoa_post_mdci_fsalloc))); + assert((H5F_NULL_FSM_ADDR(f)) || (final_eoa == f->shared->eoa_fsm_fsalloc) || + ((H5F_addr_defined(f->shared->eoa_post_mdci_fsalloc)) && + (final_eoa == f->shared->eoa_post_mdci_fsalloc))); } /* end if */ else { /* Iterate over all the free space types that have managers @@ -2068,7 +2065,7 @@ done: H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG - HDfprintf(stderr, "%s: Leaving\n", __func__); + fprintf(stderr, "%s: Leaving\n", __func__); #endif /* H5MF_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_pagefs() */ @@ -2101,8 +2098,8 @@ H5MF__close_shrink_eoa(H5F_t *f) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Construct user data for callbacks */ udata.f = f; @@ -2219,9 +2216,9 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -2262,7 +2259,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) if (!f->shared->fs_man[type] && H5F_addr_defined(f->shared->fs_addr[type])) { if (H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") - HDassert(f->shared->fs_man[type]); + assert(f->shared->fs_man[type]); fs_started[type] = TRUE; } /* end if */ @@ -2355,9 +2352,9 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* H5MF_tidy_self_referential_fsm_hack() will fail if any self * referential FSM is opened prior to the call to it. Thus call @@ -2415,7 +2412,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t if (!f->shared->fs_man[ty] && H5F_addr_defined(f->shared->fs_addr[ty])) { if (H5MF__open_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager") - HDassert(f->shared->fs_man[ty]); + assert(f->shared->fs_man[ty]); fs_started = TRUE; } /* end if */ @@ -2498,10 +2495,10 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(sect_udata); - HDassert(nums); - HDassert(fspace); + assert(f); + assert(sect_udata); + assert(nums); + assert(fspace); /* Query how many sections of this type */ if (H5FS_sect_stats(fspace, NULL, &hnums) < 0) @@ -2636,13 +2633,13 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(fsm_settled); + assert(f); + assert(f->shared); + assert(fsm_settled); /* Initialize structs */ - HDmemset(&fsinfo, 0, sizeof(fsinfo)); - HDmemset(&fs_stat, 0, sizeof(fs_stat)); + memset(&fsinfo, 0, sizeof(fsinfo)); + memset(&fs_stat, 0, sizeof(fs_stat)); /* * Only need to settle things if we are persisting free space and @@ -2653,19 +2650,19 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) hbool_t fsm_visited[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ /* Sanity check */ - HDassert(f->shared->sblock); + assert(f->shared->sblock); /* should only be called if file is opened R/W */ - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); /* shouldn't be called unless we have a superblock supporting the * superblock extension. */ - HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); /* Initialize fsm_opened and fsm_visited */ - HDmemset(fsm_opened, 0, sizeof(fsm_opened)); - HDmemset(fsm_visited, 0, sizeof(fsm_visited)); + memset(fsm_opened, 0, sizeof(fsm_opened)); + memset(fsm_visited, 0, sizeof(fsm_visited)); /* 1) Reduce the EOA to the extent possible. */ @@ -2733,15 +2730,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type); if (pass_count == 0) { /* this is the first pass */ - HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type > H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); } /* end if */ else if (H5F_PAGED_AGGR(f)) { /* page alloc active */ - HDassert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - HDassert(FALSE); + assert(FALSE); if (!fsm_visited[fsm_type]) { fsm_visited[fsm_type] = TRUE; @@ -2753,7 +2750,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (NULL == f->shared->fs_man[fsm_type]) { if (H5F_addr_defined(f->shared->fs_addr[fsm_type])) { /* Sanity check */ - HDassert(fsm_opened[fsm_type] == FALSE); + assert(fsm_opened[fsm_type] == FALSE); if (H5MF__open_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, @@ -2879,15 +2876,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type); if (pass_count == 0) { /* this is the first pass */ - HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type > H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); } /* end if */ else if (H5F_PAGED_AGGR(f)) { /* page alloc active */ - HDassert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - HDassert(FALSE); + assert(FALSE); /* Test to see if we need to switch rings -- do so if required */ if (H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) @@ -2915,7 +2912,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (!H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) { /* The current ring should be H5AC_RING_RDFSM */ - HDassert(curr_ring == H5AC_RING_RDFSM); + assert(curr_ring == H5AC_RING_RDFSM); /* Query free space manager info for this type */ if (H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) @@ -2928,7 +2925,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (fs_stat.serial_sect_count > 0) { /* Sanity check */ - HDassert(!H5F_addr_defined(fs_stat.addr)); + assert(!H5F_addr_defined(fs_stat.addr)); /* Allocate FSM header */ if (H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], @@ -2937,8 +2934,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) "can't allocated free-space header") /* Allocate FSM section info */ - HDassert(!H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); if (H5FS_alloc_sect(f, f->shared->fs_man[fsm_type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") @@ -2949,18 +2946,18 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") - HDassert(H5F_addr_defined(fs_stat.addr)); - HDassert(H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.serial_sect_count > 0); - HDassert(fs_stat.alloc_sect_size > 0); - HDassert(fs_stat.alloc_sect_size == fs_stat.sect_size); + assert(H5F_addr_defined(fs_stat.addr)); + assert(H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.serial_sect_count > 0); + assert(fs_stat.alloc_sect_size > 0); + assert(fs_stat.alloc_sect_size == fs_stat.sect_size); #endif /* NDEBUG */ } /* end if */ else { - HDassert(!H5F_addr_defined(fs_stat.addr)); - HDassert(!H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.serial_sect_count == 0); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5F_addr_defined(fs_stat.addr)); + assert(!H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.serial_sect_count == 0); + assert(fs_stat.alloc_sect_size == 0); } /* end else */ } /* end if */ } /* end if */ @@ -2978,7 +2975,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* verify that all opened FSMs were closed */ for (fsm_type = H5F_MEM_PAGE_SUPER; fsm_type < H5F_MEM_PAGE_NTYPES; fsm_type++) - HDassert(!fsm_opened[fsm_type]); + assert(!fsm_opened[fsm_type]); /* Indicate that the FSM was settled successfully */ *fsm_settled = TRUE; @@ -3108,9 +3105,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(fsm_settled); + assert(f); + assert(f->shared); + assert(fsm_settled); /* * Only need to settle things if we are persisting free space and @@ -3118,22 +3115,22 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (f->shared->fs_persist && !H5F_NULL_FSM_ADDR(f)) { /* Sanity check */ - HDassert(f->shared->lf); + assert(f->shared->lf); /* should only be called if file is opened R/W */ - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type); H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type); - HDassert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT); - HDassert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER); - HDassert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); - HDassert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); - HDassert(!H5F_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); - HDassert(!H5F_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); + assert(!H5F_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); + assert(!H5F_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); /* Note that in most cases, sm_hdr_fspace will equal sm_sinfo_fspace. */ sm_hdr_fspace = f->shared->fs_man[sm_fshdr_fs_type]; @@ -3145,14 +3142,14 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type); - HDassert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES); + assert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES); - HDassert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); + assert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); - HDassert(!H5F_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); - HDassert(!H5F_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); + assert(!H5F_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); + assert(!H5F_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); /* Note that in most cases, lg_hdr_fspace will equal lg_sinfo_fspace. */ lg_hdr_fspace = f->shared->fs_man[lg_fshdr_fs_type]; @@ -3171,9 +3168,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, sm_hdr_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - HDassert(!H5F_addr_defined(fs_stat.addr)); - HDassert(!H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5F_addr_defined(fs_stat.addr)); + assert(!H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ /* Verify that sm_sinfo_fspace is floating if it exists and is distinct */ @@ -3182,9 +3179,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, sm_sinfo_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - HDassert(!H5F_addr_defined(fs_stat.addr)); - HDassert(!H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5F_addr_defined(fs_stat.addr)); + assert(!H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ if (H5F_PAGED_AGGR(f)) { @@ -3194,9 +3191,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, lg_hdr_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info (3)") - HDassert(!H5F_addr_defined(fs_stat.addr)); - HDassert(!H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5F_addr_defined(fs_stat.addr)); + assert(!H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ /* Verify that lg_sinfo_fspace is floating if it @@ -3207,9 +3204,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, lg_sinfo_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info (4)") - HDassert(!H5F_addr_defined(fs_stat.addr)); - HDassert(!H5F_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5F_addr_defined(fs_stat.addr)); + assert(!H5F_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ } @@ -3343,8 +3340,8 @@ H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_s FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(f_sh); - HDassert(continue_alloc_fsm); + assert(f_sh); + assert(continue_alloc_fsm); /* Check sm_hdr_fspace */ if (sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) @@ -3395,9 +3392,9 @@ H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f_sh); - HDassert(fsm_type >= H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(f_sh); + assert(fsm_type >= H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm); @@ -3448,8 +3445,8 @@ H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f_sh); - HDassert(fspace); + assert(f_sh); + assert(fspace); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm); |