diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-28 22:48:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 22:48:12 (GMT) |
commit | aebac33a1f290fa5065bce96bb0512317a34c283 (patch) | |
tree | cdbae6dbd65a2eb4e6f786921ee907cec92c92d3 /tools/test | |
parent | 605cea4af60cfcbe03a54f697de392eec75e5a85 (diff) | |
download | hdf5-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 'tools/test')
-rw-r--r-- | tools/test/h5copy/h5copygentest.c | 12 | ||||
-rw-r--r-- | tools/test/h5diff/h5diffgentest.c | 68 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 350 | ||||
-rw-r--r-- | tools/test/h5format_convert/h5fc_gentest.c | 2 | ||||
-rw-r--r-- | tools/test/h5jam/getub.c | 10 | ||||
-rw-r--r-- | tools/test/h5jam/h5jamgentest.c | 6 | ||||
-rw-r--r-- | tools/test/h5repack/h5repacktst.c | 88 | ||||
-rw-r--r-- | tools/test/misc/clear_open_chk.c | 4 | ||||
-rw-r--r-- | tools/test/misc/h5clear_gentest.c | 4 | ||||
-rw-r--r-- | tools/test/misc/h5repart_gentest.c | 12 | ||||
-rw-r--r-- | tools/test/misc/talign.c | 4 | ||||
-rw-r--r-- | tools/test/perform/chunk_cache.c | 8 | ||||
-rw-r--r-- | tools/test/perform/iopipe.c | 4 | ||||
-rw-r--r-- | tools/test/perform/zip_perf.c | 14 |
14 files changed, 293 insertions, 293 deletions
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 9fb5b74..899eaa7 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -238,10 +238,10 @@ gent_named_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = HDmalloc(1 * sizeof(int)); + buf[0].p = malloc(1 * sizeof(int)); ((int *)buf[0].p)[0] = 1; buf[1].len = 2; - buf[1].p = HDmalloc(2 * sizeof(int)); + buf[1].p = malloc(2 * sizeof(int)); ((int *)buf[1].p)[0] = 2; ((int *)buf[1].p)[1] = 3; @@ -284,16 +284,16 @@ gent_nested_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = HDmalloc(1 * sizeof(hvl_t)); + buf[0].p = malloc(1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[0].p; - tvl->p = HDmalloc(1 * sizeof(int)); + tvl->p = malloc(1 * sizeof(int)); tvl->len = 1; ((int *)tvl->p)[0] = 1; buf[1].len = 1; - buf[1].p = HDmalloc(1 * sizeof(hvl_t)); + buf[1].p = malloc(1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[1].p; - tvl->p = HDmalloc(2 * sizeof(int)); + tvl->p = malloc(2 * sizeof(int)); tvl->len = 2; ((int *)tvl->p)[0] = 2; ((int *)tvl->p)[1] = 3; diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 1700177..0c253d2 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -334,17 +334,17 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDcalloc(1, sizeof(struct onion_filepaths)))) + if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; if (NULL == (paths->canon = HDstrdup(basename))) goto error; - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -352,10 +352,10 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } return NULL; } @@ -364,10 +364,10 @@ static void onion_filepaths_destroy(struct onion_filepaths *s) { if (s) { - HDfree(s->canon); - HDfree(s->onion); - HDfree(s->recovery); - HDfree(s); + free(s->canon); + free(s->onion); + free(s->recovery); + free(s); } } @@ -5020,7 +5020,7 @@ test_comps_vlen(const char *fname, const char *dset, const char *attr, int diff, /* Allocate and initialize VL data to write */ for (i = 0; i < SDIM_DSET; i++) { wdata[i].i1 = (int)i; - wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.p = malloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; for (j = 0; j < (i + 1); j++) { ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)(i * 10 + (unsigned)diff); @@ -5141,7 +5141,7 @@ test_comps_array_vlen(const char *fname, const char *dset, const char *attr, int /* Allocate and initialize VL data to write in compound2 */ for (j = 0; j < SDIM_CMPD_ARRAY; j++) { wdata[i].cmpd2[j].i2 = (int)(j * 10); - wdata[i].cmpd2[j].vl.p = HDmalloc((j + 1) * sizeof(cmpd3_t)); + wdata[i].cmpd2[j].vl.p = malloc((j + 1) * sizeof(cmpd3_t)); wdata[i].cmpd2[j].vl.len = j + 1; for (k = 0; k < (j + 1); k++) { /* Initialize data of compound3 */ @@ -5280,7 +5280,7 @@ test_comps_vlen_arry(const char *fname, const char *dset, const char *attr, int for (i = 0; i < SDIM_DSET; i++) { /* compound 1 data */ wdata[i].i1 = (int)i; - wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.p = malloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; for (j = 0; j < (i + 1); j++) { /* compound2 data */ @@ -6088,10 +6088,10 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -6349,7 +6349,7 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -6748,7 +6748,7 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -7074,10 +7074,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -7338,7 +7338,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -7738,7 +7738,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -8041,10 +8041,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -8091,7 +8091,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, /* allocate and initialize array data to write */ size = (H5TOOLS_MALLOCSIZE / sizeof(double) + 1) * sizeof(double); - dbuf = (double *)HDmalloc(size); + dbuf = (double *)malloc(size); for (jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) dbuf[jj] = (double)jj; @@ -8114,7 +8114,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, H5Dclose(ldid); H5Tclose(ltid); H5Sclose(lsid); - HDfree(dbuf); + free(dbuf); } /*------------------------------------------------------------------------- @@ -8229,7 +8229,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -8408,7 +8408,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -8500,10 +8500,10 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) int i; /* allocate the buffer for write the references */ - rbuf = (hdset_reg_ref_t *)HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = (hdset_reg_ref_t *)calloc((size_t)2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = (int *)HDmalloc(10 * 10 * sizeof(int)); + buf = (int *)malloc(10 * 10 * sizeof(int)); for (i = 0; i < 10 * 10; i++) buf[i] = i; @@ -8579,8 +8579,8 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) status = H5Sclose(sid2); assert(status >= 0); - HDfree(rbuf); - HDfree(buf); + free(rbuf); + free(buf); } /*------------------------------------------------------------------------- @@ -8631,7 +8631,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers goto out; /* create a evenly divided buffer from 0 to 127 */ - buf = (char *)HDmalloc((size_t)(nelmts * size)); + buf = (char *)malloc((size_t)(nelmts * size)); s = 1024 * 1024 / 127; for (i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { if (j == s) { @@ -8656,7 +8656,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers goto out; } } - HDfree(buf); + free(buf); buf = NULL; /* close */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 82ac178..776e914 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -470,13 +470,13 @@ gent_dataset(void) int i, j; /* Set up data arrays */ - dset1_data = (int *)HDcalloc(10 * 20, sizeof(int)); - dset1 = (int **)HDcalloc(10, sizeof(dset1_data)); + dset1_data = (int *)calloc(10 * 20, sizeof(int)); + dset1 = (int **)calloc(10, sizeof(dset1_data)); for (i = 0; i < 10; i++) dset1[i] = dset1_data + (i * 20); - dset2_data = (double *)HDcalloc(30 * 20, sizeof(double)); - dset2 = (double **)HDcalloc(30, sizeof(dset2_data)); + dset2_data = (double *)calloc(30 * 20, sizeof(double)); + dset2 = (double **)calloc(30, sizeof(dset2_data)); for (i = 0; i < 30; i++) dset2[i] = dset2_data + (i * 20); @@ -512,10 +512,10 @@ gent_dataset(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dset1); - HDfree(dset1_data); - HDfree(dset2); - HDfree(dset2_data); + free(dset1); + free(dset1_data); + free(dset2); + free(dset2_data); } static void @@ -1808,8 +1808,8 @@ gent_str(void) hsize_t mdims[2]; /* Set up data array */ - comp1_data = (compound_t *)HDcalloc(3 * 6, sizeof(compound_t)); - comp1 = (compound_t **)HDcalloc(3, sizeof(comp1_data)); + comp1_data = (compound_t *)calloc(3 * 6, sizeof(compound_t)); + comp1 = (compound_t **)calloc(3, sizeof(comp1_data)); for (i = 0; i < 3; i++) comp1[i] = comp1_data + (i * 6); @@ -1909,8 +1909,8 @@ gent_str(void) H5Fclose(fid); - HDfree(comp1); - HDfree(comp1_data); + free(comp1); + free(comp1_data); } /* @@ -2126,9 +2126,9 @@ gent_objref(void) uint64_t supports_comments = 0; /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - rbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - tbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE16, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2211,9 +2211,9 @@ gent_objref(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); } static void @@ -2240,10 +2240,10 @@ gent_datareg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2331,10 +2331,10 @@ gent_datareg(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } static void @@ -2364,10 +2364,10 @@ gent_attrreg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE64, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2464,10 +2464,10 @@ gent_attrreg(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /*taken from Elena's compound test file*/ @@ -2695,7 +2695,7 @@ gent_vldatatypes(void) for (i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + wdata[i].p = malloc((size_t)(i + 1) * sizeof(int)); wdata[i].len = (size_t)(i + 1); for (j = 0; j < i + 1; j++) @@ -2722,7 +2722,7 @@ gent_vldatatypes(void) for (i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(float)); + wdata[i].p = malloc((size_t)(i + 1) * sizeof(float)); wdata[i].len = (size_t)(i + 1); for (j = 0; j < i + 1; j++) @@ -2746,7 +2746,7 @@ gent_vldatatypes(void) assert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ - adata.p = HDmalloc(37 * sizeof(int)); + adata.p = malloc(37 * sizeof(int)); adata.len = 37; for (i = 0; i < 37; i++) @@ -2786,14 +2786,14 @@ gent_vldatatypes2(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = (hvl_t *)malloc((i + 1) * sizeof(hvl_t)); if (wdata[i].p == NULL) { printf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for (t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) { - t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned)); + t1->p = (unsigned *)malloc((j + 1) * sizeof(unsigned)); if (t1->p == NULL) { printf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2861,7 +2861,7 @@ gent_vldatatypes3(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)((float)(i * 20) / 3.0F); - wdata[i].v.p = HDmalloc((size_t)(i + 1) * sizeof(unsigned int)); + wdata[i].v.p = malloc((size_t)(i + 1) * sizeof(unsigned int)); wdata[i].v.len = (size_t)(i + 1); for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 10 + j; @@ -2929,7 +2929,7 @@ gent_vldatatypes4(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(s1)); + wdata[i].p = malloc((i + 1) * sizeof(s1)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j); @@ -3000,7 +3000,7 @@ gent_vldatatypes5(void) } /* end if */ else { wdata[i].len = (size_t)(i + 5); - wdata[i].p = HDmalloc(sizeof(unsigned) * (size_t)(i + 5)); + wdata[i].p = malloc(sizeof(unsigned) * (size_t)(i + 5)); for (j = 0; j < i + 5; j++) ((unsigned *)wdata[i].p)[j] = (unsigned)(j * 2); } /* end else */ @@ -3079,8 +3079,8 @@ gent_array1_big(void) block[0] = 1; /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - wdata = (int *)HDmalloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wdata = (int *)malloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); /* Allocate and initialize array data to write */ for (i = 0; i < SPACE_ARRAY1BIG_DIM; i++) @@ -3137,8 +3137,8 @@ gent_array1_big(void) assert(ret >= 0); /* Release memory */ - HDfree(wbuf); - HDfree(wdata); + free(wbuf); + free(wdata); } static void @@ -3447,7 +3447,7 @@ gent_array6(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) ((unsigned int *)wdata[i][j].p)[k] = (unsigned)(i * 100 + j * 10 + k); @@ -3509,7 +3509,7 @@ gent_array7(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) for (l = 0; l < ARRAY1_DIM1; l++) @@ -3577,7 +3577,7 @@ gent_array8(void) unsigned int i; /* Allocate data buffer */ - wdata = (int *)HDmalloc(F64_DIM1 * sizeof(int)); + wdata = (int *)malloc(F64_DIM1 * sizeof(int)); assert(wdata); /* @@ -3624,7 +3624,7 @@ gent_array8(void) assert(status >= 0); status = H5Fclose(file); assert(status >= 0); - HDfree(wdata); + free(wdata); } static void @@ -3869,8 +3869,8 @@ gent_multi(void) char *sv_data = NULL; haddr_t memb_addr[H5FD_MEM_NTYPES]; - sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); - sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data)); + sv_data = (char *)calloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); + sv = (char **)calloc(H5FD_MEM_NTYPES, sizeof(sv_data)); for (i = 0; i < H5FD_MEM_NTYPES; i++) sv[i] = sv_data + (i * 1024); @@ -3914,8 +3914,8 @@ gent_multi(void) H5Fclose(fid); H5Pclose(fapl); - HDfree(sv); - HDfree(sv_data); + free(sv); + free(sv_data); } static void @@ -4157,10 +4157,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4266,7 +4266,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4396,7 +4396,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -4586,10 +4586,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4695,7 +4695,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4832,7 +4832,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc(((size_t)i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc(((size_t)i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -6022,10 +6022,10 @@ gent_fvalues(void) *------------------------------------------------------------------------- */ buf3[0].len = 1; - buf3[0].p = HDmalloc(1 * sizeof(int)); + buf3[0].p = malloc(1 * sizeof(int)); ((int *)buf3[0].p)[0] = 1; buf3[1].len = 2; - buf3[1].p = HDmalloc(2 * sizeof(int)); + buf3[1].p = malloc(2 * sizeof(int)); ((int *)buf3[1].p)[0] = 2; ((int *)buf3[1].p)[1] = 3; @@ -6276,7 +6276,7 @@ gent_longlinks(void) assert(gid >= 0); /* Construct very long file name */ - objname = (char *)HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); + objname = (char *)malloc((size_t)(F51_MAX_NAME_LEN + 1)); assert(objname); for (u = 0; u < F51_MAX_NAME_LEN; u++) objname[u] = 'a'; @@ -6299,7 +6299,7 @@ gent_longlinks(void) assert(H5Fclose(fid) >= 0); /* Release memory */ - HDfree(objname); + free(objname); } /*------------------------------------------------------------------------- @@ -6520,7 +6520,7 @@ gent_bigdims(void) if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - buf = (char *)HDmalloc((unsigned)(nelmts * size)); + buf = (char *)malloc((unsigned)(nelmts * size)); for (i = 0, c = 0; i < nelmts; i++, c++) { buf[i] = c; @@ -6531,7 +6531,7 @@ gent_bigdims(void) if (H5Dwrite(did, H5T_NATIVE_SCHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /* close */ @@ -6586,7 +6586,7 @@ gent_hyperslab(void) int i; int H5_ATTR_NDEBUG_UNUSED ret; - buf = (double *)HDmalloc(32 * 4097 * sizeof(double)); + buf = (double *)malloc(32 * 4097 * sizeof(double)); for (i = 0; i < 32 * 4097; i++) buf[i] = 1; @@ -6599,7 +6599,7 @@ gent_hyperslab(void) ret = H5Fclose(fid); assert(ret >= 0); - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -7479,15 +7479,15 @@ gent_packedbits(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -7733,15 +7733,15 @@ gent_attr_intsize(void) H5Gclose(root); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } static void @@ -7925,7 +7925,7 @@ gent_compound_intsizes(void) int m, n, o; /* Array init loop vars */ /* Allocate buffer */ - Array1 = (Array1Struct *)HDmalloc(sizeof(Array1Struct) * F70_LENGTH); + Array1 = (Array1Struct *)malloc(sizeof(Array1Struct) * F70_LENGTH); assert(Array1); /* Initialize the data in the arrays/datastructure */ @@ -8159,7 +8159,7 @@ gent_compound_intsizes(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Array1); + free(Array1); } static void @@ -8208,7 +8208,7 @@ gent_compound_attr_intsizes(void) int m, n, o; /* Array init loop vars */ - Array1 = (Array1Struct *)HDcalloc(F70_LENGTH, sizeof(Array1Struct)); + Array1 = (Array1Struct *)calloc(F70_LENGTH, sizeof(Array1Struct)); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F70_LENGTH; m++) { @@ -8451,7 +8451,7 @@ gent_compound_attr_intsizes(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Array1); + free(Array1); } static void @@ -8854,15 +8854,15 @@ gent_intscalars(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -9118,15 +9118,15 @@ gent_attr_intscalars(void) H5Gclose(root); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -9229,7 +9229,7 @@ gent_compound_int_array(void) int m, n; /* Array init loop vars */ /* Allocate buffer */ - Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F76_LENGTH); + Cmpd1 = (Cmpd1Struct *)malloc(sizeof(Cmpd1Struct) * F76_LENGTH); assert(Cmpd1); /* Initialize the data in the arrays/datastructure */ @@ -9437,7 +9437,7 @@ gent_compound_int_array(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Cmpd1); + free(Cmpd1); } static void @@ -9487,9 +9487,9 @@ gent_compound_ints(void) int m; /* Array init loop vars */ /* Allocate buffers */ - Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F77_LENGTH); + Cmpd1 = (Cmpd1Struct *)malloc(sizeof(Cmpd1Struct) * F77_LENGTH); assert(Cmpd1); - Cmpd2 = (Cmpd2Struct *)HDmalloc(sizeof(Cmpd2Struct) * F77_LENGTH); + Cmpd2 = (Cmpd2Struct *)malloc(sizeof(Cmpd2Struct) * F77_LENGTH); assert(Cmpd2); /* Initialize the data in the arrays/datastructure */ @@ -9669,8 +9669,8 @@ gent_compound_ints(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Cmpd1); - HDfree(Cmpd2); + free(Cmpd1); + free(Cmpd2); } /*------------------------------------------------------------------------- @@ -9958,15 +9958,15 @@ gent_intattrscalars(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -10049,15 +10049,15 @@ gent_intsattrs(void) dset64 = malloc(sizeof(*dset64)); dsetdbl = malloc(sizeof(*dsetdbl)); - asetu8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); - asetu16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); - asetu32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); - asetu64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); - aset8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); - aset16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); - aset32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); - aset64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); - asetdbl = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(double)); + asetu8 = calloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); + asetu16 = calloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); + asetu32 = calloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); + asetu64 = calloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); + aset8 = calloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); + aset16 = calloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); + aset32 = calloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); + aset64 = calloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); + asetdbl = calloc(F66_XDIM * F66_YDIM8, sizeof(double)); fid = H5Fcreate(FILE79, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10309,25 +10309,25 @@ gent_intsattrs(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); - - HDfree(asetu8); - HDfree(asetu16); - HDfree(asetu32); - HDfree(asetu64); - HDfree(aset8); - HDfree(aset16); - HDfree(aset32); - HDfree(aset64); - HDfree(asetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); + + free(asetu8); + free(asetu16); + free(asetu32); + free(asetu64); + free(aset8); + free(aset16); + free(aset32); + free(aset64); + free(asetdbl); } /*------------------------------------------------------------------------- @@ -10374,9 +10374,9 @@ gent_floatsattrs(void) dset64 = malloc(sizeof(*dset64)); dset128 = malloc(sizeof(*dset128)); - aset32 = HDcalloc(F89_XDIM * F89_YDIM32, sizeof(float)); - aset64 = HDcalloc(F89_XDIM * F89_YDIM64, sizeof(double)); - aset128 = HDcalloc(F89_XDIM * F89_YDIM128, sizeof(long double)); + aset32 = calloc(F89_XDIM * F89_YDIM32, sizeof(float)); + aset64 = calloc(F89_XDIM * F89_YDIM64, sizeof(double)); + aset128 = calloc(F89_XDIM * F89_YDIM128, sizeof(long double)); fid = H5Fcreate(FILE89, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10473,13 +10473,13 @@ gent_floatsattrs(void) error: H5Fclose(fid); - HDfree(dset32); - HDfree(dset64); - HDfree(dset128); + free(dset32); + free(dset64); + free(dset128); - HDfree(aset32); - HDfree(aset64); - HDfree(aset128); + free(aset32); + free(aset64); + free(aset128); } static void @@ -10754,7 +10754,7 @@ gent_compound_complex2(void) hsize_t nelmts = F82_DIM32; /* Allocate buffer */ - buf = (compound *)HDmalloc(sizeof(compound) * F82_DIM32); + buf = (compound *)malloc(sizeof(compound) * F82_DIM32); assert(buf); file = H5Fcreate(FILE82, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -11010,7 +11010,7 @@ gent_compound_complex2(void) */ H5Fclose(file); - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -11367,17 +11367,17 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDcalloc(1, sizeof(struct onion_filepaths)))) + if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; if (NULL == (paths->canon = HDstrdup(basename))) goto error; - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -11385,10 +11385,10 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } return NULL; } @@ -11397,10 +11397,10 @@ static void onion_filepaths_destroy(struct onion_filepaths *s) { if (s) { - HDfree(s->canon); - HDfree(s->onion); - HDfree(s->recovery); - HDfree(s); + free(s->canon); + free(s->onion); + free(s->recovery); + free(s); } } diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index 3718964..9a3a891 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -423,7 +423,7 @@ gen_err_level(const char *fname) goto error; /* Initialize data buffer */ - buf = (unsigned char *)HDmalloc(NUM * sizeof(unsigned char *)); + buf = (unsigned char *)malloc(NUM * sizeof(unsigned char *)); HDmemset(buf, 42, NUM * sizeof(unsigned char)); /* Create the test file */ diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 192371d..5ac9c7f 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -120,7 +120,7 @@ main(int argc, char *argv[]) goto error; } /* end if */ - if (NULL == (buf = (char *)HDmalloc((unsigned)(size + 1)))) { + if (NULL == (buf = (char *)malloc((unsigned)(size + 1)))) { error_msg("can't allocate buffer \n"); goto error; } /* end if */ @@ -137,15 +137,15 @@ main(int argc, char *argv[]) } /* end if */ /* close things and exit */ - HDfree(filename); - HDfree(buf); + free(filename); + free(buf); HDclose(fd); return EXIT_SUCCESS; error: - HDfree(filename); - HDfree(buf); + free(filename); + free(buf); if (fd >= 0) HDclose(fd); return EXIT_FAILURE; diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index a9df43b..96e6407 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -369,7 +369,7 @@ create_textfile(const char *name, size_t size) if ((fd = HDcreat(name, 0777)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc(size, 1))) + if (NULL == (buf = (char *)calloc(size, 1))) goto error; /* Fill buf with pattern */ @@ -380,13 +380,13 @@ create_textfile(const char *name, size_t size) if (HDwrite(fd, buf, size) < 0) goto error; - HDfree(buf); + free(buf); HDclose(fd); return SUCCEED; error: - HDfree(buf); + free(buf); if (fd >= 0) HDclose(fd); diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index ca56c79..9364ea8 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -2505,7 +2505,7 @@ make_szip(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2517,7 +2517,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2590,7 +2590,7 @@ make_deflate(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2602,7 +2602,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2660,7 +2660,7 @@ make_shuffle(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2672,7 +2672,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2733,7 +2733,7 @@ make_fletcher32(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2745,7 +2745,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2838,7 +2838,7 @@ make_nbit(hid_t loc_id) if (H5Tclose(dtid) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2853,7 +2853,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2940,7 +2940,7 @@ make_scaleoffset(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2955,7 +2955,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -3124,7 +3124,7 @@ make_all_filters(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -3139,7 +3139,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -3321,7 +3321,7 @@ make_layout(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -3333,7 +3333,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -3406,7 +3406,7 @@ error: } H5E_END_TRY - HDfree(s_buf); + free(s_buf); return (ret_value); @@ -3533,8 +3533,8 @@ make_layout3(hid_t loc_id) if (H5Pclose(dcpl3) < 0) goto error; - HDfree(buf1); - HDfree(buf2); + free(buf1); + free(buf2); return 0; @@ -3549,8 +3549,8 @@ error: } H5E_END_TRY - HDfree(buf1); - HDfree(buf2); + free(buf1); + free(buf2); return -1; } @@ -3656,14 +3656,14 @@ make_big(hid_t loc_id) goto out; /* initialize buffer to 0 */ - buf = (signed char *)HDcalloc(nelmts, size); + buf = (signed char *)calloc(nelmts, size); if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) goto out; if (H5Dwrite(did, H5T_NATIVE_SCHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /* close */ @@ -4118,10 +4118,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4177,7 +4177,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* allocate and initialize array data to write */ size = (TEST_BUFSIZE / sizeof(double) + 1) * sizeof(double); - dbuf = (double *)HDmalloc(size); + dbuf = (double *)malloc(size); if (NULL == dbuf) { printf("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int)size / 1000000); @@ -4194,16 +4194,16 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* create a type larger than TEST_BUFSIZE */ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } size = H5Tget_size(tid); if ((sid = H5Screate_simple(1, sdims, NULL)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } #if defined(WRITE_ARRAY) @@ -4214,7 +4214,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da H5Dclose(did); H5Tclose(tid); H5Sclose(sid); - HDfree(dbuf); + free(dbuf); } /*------------------------------------------------------------------------- @@ -4347,7 +4347,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { unsigned l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -4558,7 +4558,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { unsigned l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -4682,8 +4682,8 @@ make_dset_reg_ref(hid_t loc_id) int retval = -1; /* return value */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - dwbuf = (int *)HDmalloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); /* Create dataspace for datasets */ if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0) @@ -4744,9 +4744,9 @@ make_dset_reg_ref(hid_t loc_id) out: if (wbuf) - HDfree(wbuf); + free(wbuf); if (dwbuf) - HDfree(dwbuf); + free(dwbuf); H5E_BEGIN_TRY { @@ -5016,10 +5016,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -5324,7 +5324,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { unsigned l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -5771,7 +5771,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { unsigned l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)i + 1; for (l = 0; l < i + 1; l++) if (make_diffs) @@ -6966,11 +6966,11 @@ make_complex_attr_references(hid_t loc_id) * prepare vlen data */ vlen_objref_data[0].len = LEN0_VLEN_OBJREF; - vlen_objref_data[0].p = HDmalloc(vlen_objref_data[0].len * sizeof(hobj_ref_t)); + vlen_objref_data[0].p = malloc(vlen_objref_data[0].len * sizeof(hobj_ref_t)); vlen_objref_data[1].len = LEN1_VLEN_OBJREF; - vlen_objref_data[1].p = HDmalloc(vlen_objref_data[1].len * sizeof(hobj_ref_t)); + vlen_objref_data[1].p = malloc(vlen_objref_data[1].len * sizeof(hobj_ref_t)); vlen_objref_data[2].len = LEN2_VLEN_OBJREF; - vlen_objref_data[2].p = HDmalloc(vlen_objref_data[2].len * sizeof(hobj_ref_t)); + vlen_objref_data[2].p = malloc(vlen_objref_data[2].len * sizeof(hobj_ref_t)); /* * create obj references @@ -7034,7 +7034,7 @@ make_complex_attr_references(hid_t loc_id) * prepare vlen data */ vlen_regref_data[0].len = LEN0_VLEN_REGREF; - vlen_regref_data[0].p = HDmalloc(vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); + vlen_regref_data[0].p = malloc(vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); /* * create region reference diff --git a/tools/test/misc/clear_open_chk.c b/tools/test/misc/clear_open_chk.c index ac31375..b57eb4a 100644 --- a/tools/test/misc/clear_open_chk.c +++ b/tools/test/misc/clear_open_chk.c @@ -54,10 +54,10 @@ main(int argc, char *argv[]) /* Try opening the file */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { fprintf(stderr, "clear_open_chk: unable to open the file\n"); - HDfree(fname); + free(fname); HDexit(EXIT_FAILURE); } - HDfree(fname); + free(fname); /* Close the file */ if (H5Fclose(fid) < 0) { diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 31796c1..3636c98 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -124,7 +124,7 @@ gen_cache_image_file(const char *fname) if (H5Fclose(fid) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -140,7 +140,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return 1; } /* gen_cache_image_file() */ diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index 04ac8e7..1f26c4d 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -36,12 +36,12 @@ main(void) hsize_t dims[2] = {FAMILY_NUMBER, FAMILY_SIZE}; /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { - HDperror("HDcalloc"); + if (NULL == (buf_data = (int *)calloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { + HDperror("calloc"); HDexit(EXIT_FAILURE); } - if (NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) { - HDperror("HDcalloc"); + if (NULL == (buf = (int **)calloc(FAMILY_NUMBER, sizeof(buf_data)))) { + HDperror("calloc"); HDexit(EXIT_FAILURE); } for (i = 0; i < FAMILY_NUMBER; i++) @@ -103,8 +103,8 @@ main(void) HDexit(EXIT_FAILURE); } - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); HDputs(" PASSED"); HDfflush(stdout); diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index 72b98ed..c876d9f 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -122,7 +122,7 @@ main(void) H5Dclose(set); /* Now open the set, and read it back in */ - data = (char *)HDmalloc(H5Tget_size(fix)); + data = (char *)malloc(H5Tget_size(fix)); if (!data) { HDperror("malloc() failed"); @@ -186,7 +186,7 @@ out: } if (data) - HDfree(data); + free(data); H5Sclose(spc); H5Tclose(cs6); H5Tclose(cmp); diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 33ea706..3d258ea 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -134,7 +134,7 @@ create_dset1(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); - HDfree(data); + free(data); return 0; error: @@ -145,7 +145,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY - HDfree(data); + free(data); return 1; } @@ -198,7 +198,7 @@ create_dset2(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); - HDfree(data); + free(data); return 0; @@ -210,7 +210,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY - HDfree(data); + free(data); return 1; } diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index d47420a..8d0daf0 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -159,7 +159,7 @@ main(void) assert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(dset >= 0); - the_data = (unsigned char *)HDmalloc((size_t)(size[0] * size[1])); + the_data = (unsigned char *)malloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); @@ -347,7 +347,7 @@ main(void) H5Sclose(file_space); H5Fclose(file); - HDfree(the_data); + free(the_data); return 0; } diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index abd1649..c891bf9 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -104,7 +104,7 @@ cleanup(void) { if (!HDgetenv(HDF5_NOCLEANUP)) HDunlink(filename); - HDfree(filename); + free(filename); } static void @@ -117,7 +117,7 @@ write_file(Bytef *source, uLongf sourceLen) /* destination buffer needs to be at least 0.1% larger than sourceLen * plus 12 bytes */ destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12; - dest = (Bytef *)HDmalloc(destLen); + dest = (Bytef *)malloc(destLen); if (!dest) error("out of memory"); @@ -151,7 +151,7 @@ write_file(Bytef *source, uLongf sourceLen) d_ptr += rc; } - HDfree(dest); + free(dest); } /* @@ -211,9 +211,9 @@ get_unique_name(void) if (prefix) /* 2 = 1 for '/' + 1 for null terminator */ - filename = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); + filename = (char *)malloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); else - filename = (char *)HDmalloc(HDstrlen(ZIP_PERF_FILE) + 1); + filename = (char *)malloc(HDstrlen(ZIP_PERF_FILE) + 1); if (!filename) error("out of memory"); @@ -364,7 +364,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long unsigned long i, iters; iters = file_size / src_len; - src = (Bytef *)HDcalloc(1, sizeof(Bytef) * src_len); + src = (Bytef *)calloc(1, sizeof(Bytef) * src_len); if (!src) { cleanup(); @@ -452,7 +452,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long fprintf(stdout, "\tCompression Time: %gs\n", compression_time); HDunlink(filename); - HDfree(src); + free(src); } } |