summaryrefslogtreecommitdiffstats
path: root/src/H5MPtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5MPtest.c')
-rw-r--r--src/H5MPtest.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/H5MPtest.c b/src/H5MPtest.c
index fa5b165..d121666 100644
--- a/src/H5MPtest.c
+++ b/src/H5MPtest.c
@@ -17,19 +17,18 @@
* Purpose: Memory pool testing functions.
*/
-#include "H5MPmodule.h" /* This source code file is part of the H5MP module */
-#define H5MP_TESTING /*include H5MP testing funcs*/
+#include "H5MPmodule.h" /* This source code file is part of the H5MP module */
+#define H5MP_TESTING /*include H5MP testing funcs*/
/* Private headers */
-#include "H5private.h" /* Generic Functions */
-#include "H5MPpkg.h" /* Memory Pools */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5MPpkg.h" /* Memory Pools */
+#include "H5Eprivate.h" /* Error handling */
/* Static Prototypes */
/* Package variables */
-
/*-------------------------------------------------------------------------
* Function: H5MP_get_pool_free_size
*
@@ -59,7 +58,6 @@ H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5MP_get_pool_free_size() */
-
/*-------------------------------------------------------------------------
* Function: H5MP_get_pool_first_page
*
@@ -89,7 +87,6 @@ H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5MP_get_pool_first_page() */
-
/*-------------------------------------------------------------------------
* Function: H5MP_pool_is_free_size_correct
*
@@ -110,9 +107,9 @@ H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page)
htri_t
H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
{
- H5MP_page_t *page; /* Pointer to current page */
- size_t pool_free; /* Size of pages' free space */
- htri_t ret_value = TRUE; /* Return value */
+ H5MP_page_t *page; /* Pointer to current page */
+ size_t pool_free; /* Size of pages' free space */
+ htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -121,25 +118,25 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
/* Iterate through pages, checking the free size & accumulating the
* free space for all the pages */
- page = mp->first;
+ page = mp->first;
pool_free = 0;
- while(page != NULL) {
- H5MP_page_blk_t *blk; /* Pointer to current free block */
- size_t page_free; /* Size of blocks on free list */
+ while (page != NULL) {
+ H5MP_page_blk_t *blk; /* Pointer to current free block */
+ size_t page_free; /* Size of blocks on free list */
/* Iterate through the blocks in page, accumulating free space */
blk = (H5MP_page_blk_t *)((void *)((unsigned char *)page + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))));
page_free = 0;
- while(blk != NULL) {
- if(blk->is_free)
+ while (blk != NULL) {
+ if (blk->is_free)
page_free += blk->size;
blk = blk->next;
} /* end while */
/* Check that the free space from the blocks on the free list
* corresponds to space in page */
- if(page_free != page->free_size)
- HGOTO_DONE (FALSE)
+ if (page_free != page->free_size)
+ HGOTO_DONE(FALSE)
/* Increment the amount of free space in pool */
pool_free += page->free_size;
@@ -150,14 +147,13 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
/* Check that the free space from the pages
* corresponds to free space in pool */
- if(pool_free != mp->free_size)
- HGOTO_DONE (FALSE)
+ if (pool_free != mp->free_size)
+ HGOTO_DONE(FALSE)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5MP_pool_is_free_size_correct() */
-
/*-------------------------------------------------------------------------
* Function: H5MP_get_page_free_size
*
@@ -187,7 +183,6 @@ H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5MP_get_page_free_size() */
-
/*-------------------------------------------------------------------------
* Function: H5MP_get_page_next_page
*
@@ -216,4 +211,3 @@ H5MP_get_page_next_page(const H5MP_page_t *page, H5MP_page_t **next_page)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5MP_get_page_next_page() */
-