summaryrefslogtreecommitdiffstats
path: root/c++/test/trefer.cpp
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 22:48:12 (GMT)
committerGitHub <noreply@github.com>2023-06-28 22:48:12 (GMT)
commitaebac33a1f290fa5065bce96bb0512317a34c283 (patch)
treecdbae6dbd65a2eb4e6f786921ee907cec92c92d3 /c++/test/trefer.cpp
parent605cea4af60cfcbe03a54f697de392eec75e5a85 (diff)
downloadhdf5-aebac33a1f290fa5065bce96bb0512317a34c283.zip
hdf5-aebac33a1f290fa5065bce96bb0512317a34c283.tar.gz
hdf5-aebac33a1f290fa5065bce96bb0512317a34c283.tar.bz2
Remove HD from memory allocate/free calls (#3195)
* HDcalloc * HDfree * HDmalloc * HDrealloc
Diffstat (limited to 'c++/test/trefer.cpp')
-rw-r--r--c++/test/trefer.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index fc7931f..f207eb7 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -80,9 +80,9 @@ test_reference_params()
// Allocate write & read buffers
size_t temp_size = MAX(sizeof(unsigned), sizeof(hobj_ref_t));
- wbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
- rbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
- tbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
+ wbuf = static_cast<hobj_ref_t *>(malloc(temp_size * SPACE1_DIM1));
+ rbuf = static_cast<hobj_ref_t *>(malloc(temp_size * SPACE1_DIM1));
+ tbuf = static_cast<hobj_ref_t *>(malloc(temp_size * SPACE1_DIM1));
// Create file FILE1
file1 = new H5File(FILE1, H5F_ACC_TRUNC);
@@ -168,9 +168,9 @@ test_reference_params()
// Let sid1 go out of scope
// Free memory buffers
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(tbuf);
+ free(wbuf);
+ free(rbuf);
+ free(tbuf);
PASSED();
} // end try
@@ -206,9 +206,9 @@ test_reference_obj()
// Allocate write & read buffers
size_t temp_size = MAX(sizeof(unsigned), sizeof(hobj_ref_t));
- wbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
- rbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
- tbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
+ wbuf = static_cast<hobj_ref_t *>(malloc(temp_size * SPACE1_DIM1));
+ rbuf = static_cast<hobj_ref_t *>(malloc(temp_size * SPACE1_DIM1));
+ tbuf = static_cast<hobj_ref_t *>(malloc(temp_size * SPACE1_DIM1));
// Create file FILE1
file1 = new H5File(FILE1, H5F_ACC_TRUNC);
@@ -368,9 +368,9 @@ test_reference_obj()
file1->close();
// Free allocated buffers
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(tbuf);
+ free(wbuf);
+ free(rbuf);
+ free(tbuf);
PASSED();
} // end try
@@ -555,10 +555,10 @@ test_reference_region_1D()
*drbuf; // Buffer for reading numeric data from disk
// Allocate write & read buffers
- wbuf = static_cast<hdset_reg_ref_t *>(HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1));
- rbuf = static_cast<hdset_reg_ref_t *>(HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1));
- dwbuf = static_cast<uint8_t *>(HDmalloc(sizeof(uint8_t) * SPACE3_DIM1));
- drbuf = static_cast<uint8_t *>(HDcalloc(sizeof(uint8_t), SPACE3_DIM1));
+ wbuf = static_cast<hdset_reg_ref_t *>(calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1));
+ rbuf = static_cast<hdset_reg_ref_t *>(malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1));
+ dwbuf = static_cast<uint8_t *>(malloc(sizeof(uint8_t) * SPACE3_DIM1));
+ drbuf = static_cast<uint8_t *>(calloc(sizeof(uint8_t), SPACE3_DIM1));
// Create file FILE1
H5File file1(FILE2, H5F_ACC_TRUNC);
@@ -714,7 +714,7 @@ test_reference_region_1D()
/* Allocate space for the hyperslab blocks */
coords =
- static_cast<hsize_t *>(HDmalloc(static_cast<size_t>(nelms) * SPACE3_RANK * sizeof(hsize_t) * 2));
+ static_cast<hsize_t *>(malloc(static_cast<size_t>(nelms) * SPACE3_RANK * sizeof(hsize_t) * 2));
// Get the list of hyperslab blocks currently selected
reg_sp.getSelectHyperBlocklist(0, static_cast<hsize_t>(nelms), coords);
@@ -751,7 +751,7 @@ test_reference_region_1D()
verify_val(static_cast<long>(coords[28]), 72, "Hyperslab Coordinates", __LINE__, __FILE__);
verify_val(static_cast<long>(coords[29]), 73, "Hyperslab Coordinates", __LINE__, __FILE__);
- HDfree(coords);
+ free(coords);
// Check boundaries
reg_sp.getSelectBounds(low, high);
@@ -774,7 +774,7 @@ test_reference_region_1D()
/* Allocate space for the hyperslab blocks */
coords =
- static_cast<hsize_t *>(HDmalloc(static_cast<size_t>(nelmspts) * SPACE3_RANK * sizeof(hsize_t)));
+ static_cast<hsize_t *>(malloc(static_cast<size_t>(nelmspts) * SPACE3_RANK * sizeof(hsize_t)));
// Get the list of element points currently selected
elm_sp.getSelectElemPointlist(0, static_cast<hsize_t>(nelmspts), coords);
@@ -791,7 +791,7 @@ test_reference_region_1D()
verify_val(coords[8], coord1[8][0], "Element Coordinates", __LINE__, __FILE__);
verify_val(coords[9], coord1[9][0], "Element Coordinates", __LINE__, __FILE__);
- HDfree(coords);
+ free(coords);
// Check boundaries
elm_sp.getSelectBounds(low, high);
@@ -808,10 +808,10 @@ test_reference_region_1D()
file1.close();
// Free memory buffers
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(dwbuf);
- HDfree(drbuf);
+ free(wbuf);
+ free(rbuf);
+ free(dwbuf);
+ free(drbuf);
PASSED();
} // end try