summaryrefslogtreecommitdiffstats
path: root/test/trefer.c
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 /test/trefer.c
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 'test/trefer.c')
-rw-r--r--test/trefer.c162
1 files changed, 81 insertions, 81 deletions
diff --git a/test/trefer.c b/test/trefer.c
index b725b90..aa90051 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -110,10 +110,10 @@ test_reference_params(void)
MESSAGE(5, ("Testing Reference Parameters\n"));
/* Allocate write & read buffers */
- wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ wbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ tbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ obuf = calloc(sizeof(unsigned), SPACE1_DIM1);
for (i = 0; i < SPACE1_DIM1; i++)
obuf[i] = i * 3;
@@ -409,10 +409,10 @@ test_reference_params(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(tbuf);
- HDfree(obuf);
+ free(wbuf);
+ free(rbuf);
+ free(tbuf);
+ free(obuf);
} /* test_reference_params() */
/****************************************************************
@@ -443,10 +443,10 @@ test_reference_obj(void)
MESSAGE(5, ("Testing Object Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ ibuf = calloc(sizeof(unsigned), SPACE1_DIM1);
+ obuf = calloc(sizeof(unsigned), SPACE1_DIM1);
for (i = 0; i < SPACE1_DIM1; i++)
obuf[i] = i * 3;
@@ -643,10 +643,10 @@ test_reference_obj(void)
}
/* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(ibuf);
- HDfree(obuf);
+ free(wbuf);
+ free(rbuf);
+ free(ibuf);
+ free(obuf);
} /* test_reference_obj() */
/****************************************************************
@@ -680,9 +680,9 @@ test_reference_vlen_obj(void)
MESSAGE(5, ("Testing Object Reference Functions within VLEN type\n"));
/* Allocate write & read buffers */
- wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ ibuf = calloc(sizeof(unsigned), SPACE1_DIM1);
+ obuf = calloc(sizeof(unsigned), SPACE1_DIM1);
for (i = 0; i < SPACE1_DIM1; i++)
obuf[i] = i * 3;
@@ -909,10 +909,10 @@ test_reference_vlen_obj(void)
}
/* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(ibuf);
- HDfree(obuf);
+ free(wbuf);
+ free(rbuf);
+ free(ibuf);
+ free(obuf);
} /* test_reference_vlen_obj() */
/****************************************************************
@@ -944,8 +944,8 @@ test_reference_cmpnd_obj(void)
MESSAGE(5, ("Testing Object Reference Functions within compound type\n"));
/* Allocate write & read buffers */
- ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ ibuf = calloc(sizeof(unsigned), SPACE1_DIM1);
+ obuf = calloc(sizeof(unsigned), SPACE1_DIM1);
for (i = 0; i < SPACE1_DIM1; i++)
obuf[i] = i * 3;
@@ -1200,8 +1200,8 @@ test_reference_cmpnd_obj(void)
CHECK(ret, FAIL, "H5Rdestroy");
/* Free memory buffers */
- HDfree(ibuf);
- HDfree(obuf);
+ free(ibuf);
+ free(obuf);
} /* test_reference_cmpnd_obj() */
/****************************************************************
@@ -1253,10 +1253,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
MESSAGE(5, ("Testing Dataset Region Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
+ wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ dwbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
+ drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
for (tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++)
*tu8++ = (uint8_t)(i * 3);
@@ -1527,7 +1527,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(ret, 1, "H5Sget_select_hyper_nblocks");
/* allocate space for the hyperslab blocks */
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2);
+ coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2);
ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords);
CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
@@ -1535,7 +1535,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(coords[1], 2, "Hyperslab Coordinates");
VERIFY(coords[2], 7, "Hyperslab Coordinates");
VERIFY(coords[3], 7, "Hyperslab Coordinates");
- HDfree(coords);
+ free(coords);
ret = H5Sget_select_bounds(sid2, low, high);
CHECK(ret, FAIL, "H5Sget_select_bounds");
VERIFY(low[0], 2, "Selection Bounds");
@@ -1558,7 +1558,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(ret, SPACE2_DIM2, "H5Sget_select_elem_npoints");
/* allocate space for the element points */
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t));
+ coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t));
ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords);
CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
@@ -1582,7 +1582,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(coords[17], coord1[8][1], "Element Coordinates");
VERIFY(coords[18], coord1[9][0], "Element Coordinates");
VERIFY(coords[19], coord1[9][1], "Element Coordinates");
- HDfree(coords);
+ free(coords);
ret = H5Sget_select_bounds(sid2, low, high);
CHECK(ret, FAIL, "H5Sget_select_bounds");
VERIFY(low[0], 0, "Selection Bounds");
@@ -1659,10 +1659,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
}
/* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(dwbuf);
- HDfree(drbuf);
+ free(wbuf);
+ free(rbuf);
+ free(dwbuf);
+ free(drbuf);
} /* test_reference_region() */
@@ -1709,10 +1709,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
- rbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
- dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
- drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
+ wbuf = calloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
+ rbuf = calloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
+ dwbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
+ drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++)
*tu8++ = (uint8_t)(i * 3);
@@ -1887,7 +1887,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(ret, 15, "H5Sget_select_hyper_nblocks");
/* allocate space for the hyperslab blocks */
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2);
+ coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2);
ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords);
CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
@@ -1921,7 +1921,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(coords[27], 68, "Hyperslab Coordinates");
VERIFY(coords[28], 72, "Hyperslab Coordinates");
VERIFY(coords[29], 73, "Hyperslab Coordinates");
- HDfree(coords);
+ free(coords);
ret = H5Sget_select_bounds(sid3, low, high);
CHECK(ret, FAIL, "H5Sget_select_bounds");
VERIFY(low[0], 2, "Selection Bounds");
@@ -1942,7 +1942,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(ret, 10, "H5Sget_select_elem_npoints");
/* allocate space for the element points */
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t));
+ coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t));
ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords);
CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
@@ -1956,7 +1956,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(coords[7], coord1[7][0], "Element Coordinates");
VERIFY(coords[8], coord1[8][0], "Element Coordinates");
VERIFY(coords[9], coord1[9][0], "Element Coordinates");
- HDfree(coords);
+ free(coords);
ret = H5Sget_select_bounds(sid3, low, high);
CHECK(ret, FAIL, "H5Sget_select_bounds");
VERIFY(low[0], 3, "Selection Bounds");
@@ -2000,10 +2000,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
}
/* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(dwbuf);
- HDfree(drbuf);
+ free(wbuf);
+ free(rbuf);
+ free(dwbuf);
+ free(drbuf);
} /* test_reference_region_1D() */
@@ -2855,10 +2855,10 @@ test_reference_compat_conv(void)
MESSAGE(5, ("Testing Deprecated Object Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
- rbuf_obj = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- wbuf_reg = HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
- rbuf_reg = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_obj = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ rbuf_obj = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg = calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ rbuf_reg = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
/* Create file */
fid1 = H5Fcreate(FILE_REF_COMPAT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -3125,10 +3125,10 @@ test_reference_compat_conv(void)
}
/* Free memory buffers */
- HDfree(wbuf_obj);
- HDfree(rbuf_obj);
- HDfree(wbuf_reg);
- HDfree(rbuf_reg);
+ free(wbuf_obj);
+ free(rbuf_obj);
+ free(wbuf_reg);
+ free(rbuf_reg);
} /* test_reference_compat() */
/****************************************************************
@@ -3167,17 +3167,17 @@ test_reference_perf(void)
MESSAGE(5, ("Testing Object Reference Performance\n"));
/* Allocate write & read buffers */
- wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- wbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- rbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
- tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- wbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- rbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- wbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
- rbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ obuf = calloc(sizeof(unsigned), SPACE1_DIM1);
+ ibuf = calloc(sizeof(unsigned), SPACE1_DIM1);
+ wbuf_deprec = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ rbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_deprec = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ tbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_reg = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg_deprec = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ rbuf_reg_deprec = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
for (i = 0; i < SPACE1_DIM1; i++)
obuf[i] = i * 3;
@@ -3536,17 +3536,17 @@ test_reference_perf(void)
}
/* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(wbuf_reg);
- HDfree(rbuf_reg);
- HDfree(wbuf_deprec);
- HDfree(rbuf_deprec);
- HDfree(wbuf_reg_deprec);
- HDfree(rbuf_reg_deprec);
- HDfree(tbuf);
- HDfree(ibuf);
- HDfree(obuf);
+ free(wbuf);
+ free(rbuf);
+ free(wbuf_reg);
+ free(rbuf_reg);
+ free(wbuf_deprec);
+ free(rbuf_deprec);
+ free(wbuf_reg_deprec);
+ free(rbuf_reg_deprec);
+ free(tbuf);
+ free(ibuf);
+ free(obuf);
} /* test_reference_perf() */
/****************************************************************