diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2021-05-05 19:52:43 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2021-05-05 19:52:43 (GMT) |
commit | 54c202e4ec4bc9c7e45543cea5b51868a091b3e9 (patch) | |
tree | 86e6de08c7b390c66e401a291bb83619c0cfac7e /src/H5MP.c | |
parent | 8e27e7357506958128d087c4e93e3dcb4fb52ace (diff) | |
download | hdf5-54c202e4ec4bc9c7e45543cea5b51868a091b3e9.zip hdf5-54c202e4ec4bc9c7e45543cea5b51868a091b3e9.tar.gz hdf5-54c202e4ec4bc9c7e45543cea5b51868a091b3e9.tar.bz2 |
Normalization with develop (mainly VFDs)
Diffstat (limited to 'src/H5MP.c')
-rw-r--r-- | src/H5MP.c | 30 |
1 files changed, 6 insertions, 24 deletions
@@ -15,7 +15,7 @@ * * Created: H5MP.c * May 2 2005 - * Quincey Koziol <koziol@ncsa.uiuc.edu> + * Quincey Koziol * * Purpose: Implements memory pools. (Similar to Apache's APR * memory pools) @@ -76,7 +76,6 @@ H5FL_DEFINE(H5MP_pool_t); * Return: Pointer to the memory pool "header" on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2005 * *------------------------------------------------------------------------- @@ -118,26 +117,25 @@ done: } /* end H5MP_create() */ /*------------------------------------------------------------------------- - * Function: H5MP_new_page + * Function: H5MP__new_page * * Purpose: Allocate new page for a memory pool * * Return: Pointer to the page allocated on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 4 2005 * *------------------------------------------------------------------------- */ static H5MP_page_t * -H5MP_new_page(H5MP_pool_t *mp, size_t page_size) +H5MP__new_page(H5MP_pool_t *mp, size_t page_size) { H5MP_page_t * new_page; /* New page created */ H5MP_page_blk_t *first_blk; /* Pointer to first block in page */ H5MP_page_t * ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mp); @@ -156,9 +154,6 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size) new_page->free_size = mp->max_size; new_page->fac_alloc = TRUE; } /* end else */ -#ifdef QAK - HDfprintf(stderr, "%s: Allocating new page = %p\n", FUNC, new_page); -#endif /* QAK */ /* Initialize page information */ first_blk = H5MP_PAGE_FIRST_BLOCK(new_page); @@ -184,7 +179,7 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MP_new_page() */ +} /* end H5MP__new_page() */ /*------------------------------------------------------------------------- * Function: H5MP_malloc @@ -194,7 +189,6 @@ done: * Return: Pointer to the space allocated on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2005 * *------------------------------------------------------------------------- @@ -215,10 +209,6 @@ H5MP_malloc(H5MP_pool_t *mp, size_t request) /* Compute actual size needed */ needed = H5MP_BLOCK_ALIGN(request) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)); -#ifdef QAK - HDfprintf(stderr, "%s: sizeof(H5MP_page_blk_t) = %Zu\n", FUNC, sizeof(H5MP_page_blk_t)); - HDfprintf(stderr, "%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); -#endif /* QAK */ /* See if the request can be handled by existing free space */ if (needed <= mp->free_size) { @@ -267,7 +257,7 @@ H5MP_malloc(H5MP_pool_t *mp, size_t request) (needed > mp->max_size) ? (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size; /* Allocate new page */ - if (NULL == (alloc_page = H5MP_new_page(mp, page_size))) + if (NULL == (alloc_page = H5MP__new_page(mp, page_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for page") /* Set the block to allocate from */ @@ -315,9 +305,6 @@ found: /* Set new space pointer for the return value */ ret_value = ((unsigned char *)alloc_free) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)); -#ifdef QAK - HDfprintf(stderr, "%s: Allocating space from page, ret_value = %p\n", FUNC, ret_value); -#endif /* QAK */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -331,7 +318,6 @@ done: * Return: NULL on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 3 2005 * * Note: Should we release pages that have no used blocks? @@ -361,9 +347,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc) /* Add it's space to the amount of free space in the page & pool */ spc_page = spc_blk->page; -#ifdef QAK - HDfprintf(stderr, "%s: Freeing from page = %p\n", "H5MP_free", spc_page); -#endif /* QAK */ spc_page->free_size += spc_blk->size; mp->free_size += spc_blk->size; @@ -420,7 +403,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc) * Return: Non-negative on success/negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 3 2005 * *------------------------------------------------------------------------- |