diff options
author | Quincey Koziol <koziol@koziol.gov> | 2020-03-20 21:39:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@koziol.gov> | 2020-03-20 21:39:55 (GMT) |
commit | b51585a9110c4322c52f9dcdc60cd26c3ea44546 (patch) | |
tree | f22fc832a4b5b3534de82d00dd46d37d92a47b65 /test/tmisc.c | |
parent | 66350c3356876d590ba250e75fd8d68a66af76f9 (diff) | |
download | hdf5-b51585a9110c4322c52f9dcdc60cd26c3ea44546.zip hdf5-b51585a9110c4322c52f9dcdc60cd26c3ea44546.tar.gz hdf5-b51585a9110c4322c52f9dcdc60cd26c3ea44546.tar.bz2 |
Revise API for H5get_alloc_stats() to take a struct instead of separate values.
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index a555b3e..bd9ae53 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5709,13 +5709,7 @@ test_misc35(void) size_t arr_size_final; /* Final amount of array memory allocated */ size_t blk_size_final; /* Final amount of block memory allocated */ size_t fac_size_final; /* Final amount of factory memory allocated */ - unsigned long long total_alloc_bytes; /* Running count of total # of bytes allocated */ - size_t curr_alloc_bytes; /* Current # of bytes allocated */ - size_t peak_alloc_bytes; /* Peak # of bytes allocated */ - size_t max_block_size; /* Largest block allocated */ - size_t total_alloc_blocks_count; /* Running count of total # of blocks allocated */ - size_t curr_alloc_blocks_count; /* Current # of blocks allocated */ - size_t peak_alloc_blocks_count; /* Peak # of blocks allocated */ + H5_alloc_stats_t alloc_stats; /* Memory stats */ herr_t ret; /* Return value */ /* Output message about test being performed */ @@ -5778,43 +5772,41 @@ test_misc35(void) ERROR("fac_size_final > fac_size_start"); /* Retrieve memory allocation statistics */ - ret = H5get_alloc_stats(&total_alloc_bytes, &curr_alloc_bytes, - &peak_alloc_bytes, &max_block_size, &total_alloc_blocks_count, - &curr_alloc_blocks_count, &peak_alloc_blocks_count); + ret = H5get_alloc_stats(&alloc_stats); CHECK(ret, FAIL, "H5get_alloc_stats"); #if defined H5_MEMORY_ALLOC_SANITY_CHECK /* All the values should be >0 */ - if(0 == total_alloc_bytes) - ERROR("total_alloc_bytes == 0"); - if(0 == curr_alloc_bytes) - ERROR("curr_alloc_bytes == 0"); - if(0 == peak_alloc_bytes) - ERROR("peak_alloc_bytes == 0"); - if(0 == max_block_size) - ERROR("max_block_size == 0"); - if(0 == total_alloc_blocks_count) - ERROR("total_alloc_blocks_count == 0"); - if(0 == curr_alloc_blocks_count) - ERROR("curr_alloc_blocks_count == 0"); - if(0 == peak_alloc_blocks_count) - ERROR("peak_alloc_blocks_count == 0"); + if(0 == alloc_stats.total_alloc_bytes) + ERROR("alloc_stats.total_alloc_bytes == 0"); + if(0 == alloc_stats.curr_alloc_bytes) + ERROR("alloc_stats.curr_alloc_bytes == 0"); + if(0 == alloc_stats.peak_alloc_bytes) + ERROR("alloc_stats.peak_alloc_bytes == 0"); + if(0 == alloc_stats.max_block_size) + ERROR("alloc_stats.max_block_size == 0"); + if(0 == alloc_stats.total_alloc_blocks_count) + ERROR("alloc_stats.total_alloc_blocks_count == 0"); + if(0 == alloc_stats.curr_alloc_blocks_count) + ERROR("alloc_stats.curr_alloc_blocks_count == 0"); + if(0 == alloc_stats.peak_alloc_blocks_count) + ERROR("alloc_stats.peak_alloc_blocks_count == 0"); #else /* H5_MEMORY_ALLOC_SANITY_CHECK */ /* All the values should be == 0 */ - if(0 != total_alloc_bytes) - ERROR("total_alloc_bytes != 0"); - if(0 != curr_alloc_bytes) - ERROR("curr_alloc_bytes != 0"); - if(0 != peak_alloc_bytes) - ERROR("peak_alloc_bytes != 0"); - if(0 != max_block_size) - ERROR("max_block_size != 0"); - if(0 != total_alloc_blocks_count) - ERROR("total_alloc_blocks_count != 0"); - if(0 != curr_alloc_blocks_count) - ERROR("curr_alloc_blocks_count != 0"); - if(0 != peak_alloc_blocks_count) - ERROR("peak_alloc_blocks_count != 0"); + if(0 != alloc_stats.total_alloc_bytes) + ERROR("alloc_stats.total_alloc_bytes != 0"); + if(0 != alloc_stats.curr_alloc_bytes) + ERROR("alloc_stats.curr_alloc_bytes != 0"); + if(0 != alloc_stats.peak_alloc_bytes) + ERROR("alloc_stats.peak_alloc_bytes != 0"); + if(0 != alloc_stats.max_block_size) + ERROR("alloc_stats.max_block_size != 0"); + if(0 != alloc_stats.total_alloc_blocks_count) + ERROR("alloc_stats.total_alloc_blocks_count != 0"); + if(0 != alloc_stats.curr_alloc_blocks_count) + ERROR("alloc_stats.curr_alloc_blocks_count != 0"); + if(0 != alloc_stats.peak_alloc_blocks_count) + ERROR("alloc_stats.peak_alloc_blocks_count != 0"); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ } /* end test_misc35() */ |