summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repacktst.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2013-10-31 04:20:36 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2013-10-31 04:20:36 (GMT)
commite6cace9ee46e903a8612aba7d9d1d72fa0968217 (patch)
treeac7d07ea06d3d5ac73e34bc54ff17620a4d083fe /tools/h5repack/h5repacktst.c
parent2eb24b16dac78b3e27769c20502299475fb8dde6 (diff)
downloadhdf5-e6cace9ee46e903a8612aba7d9d1d72fa0968217.zip
hdf5-e6cace9ee46e903a8612aba7d9d1d72fa0968217.tar.gz
hdf5-e6cace9ee46e903a8612aba7d9d1d72fa0968217.tar.bz2
[svn-r24376] Updated all code to use HDmalloc, HDcalloc, and HDfree.
Prep work for adding a memory free function, part of HDFFV-8551. Tested on: 32-bit LE linux (jam) * with C++, Fortran * with thread safety on These are minor changes (almost entirely renaming foo functions to HDfoo) that don't change functionality. This should not require a full commit test.
Diffstat (limited to 'tools/h5repack/h5repacktst.c')
-rw-r--r--tools/h5repack/h5repacktst.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index 791e268..ba6b499 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -3333,7 +3333,7 @@ int make_big(hid_t loc_id)
goto out;
/* initialize buffer to 0 */
- buf=(signed char *) calloc( nelmts, size);
+ buf=(signed char *) HDcalloc( nelmts, size);
if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0)
goto out;
@@ -3814,10 +3814,10 @@ int write_dset_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
+ buf5[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf5[1].p)[0] = 2;
((int *)buf5[1].p)[1] = 3;
@@ -3876,7 +3876,7 @@ int write_dset_in(hid_t loc_id,
/* allocate and initialize array data to write */
size = ( TEST_BUFSIZE / sizeof(double) + 1 ) * sizeof(double);
- dbuf = (double*)malloc( size );
+ dbuf = (double*)HDmalloc( size );
if (NULL == dbuf)
{
printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
@@ -4050,7 +4050,7 @@ int write_dset_in(hid_t loc_id,
{
int l;
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = (size_t)(i + 1);
for(l = 0; l < i + 1; l++)
{
@@ -4271,7 +4271,7 @@ int write_dset_in(hid_t loc_id,
{
int l;
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = (size_t)(i + 1);
for(l = 0; l < i + 1; l++)
{
@@ -4401,8 +4401,8 @@ int make_dset_reg_ref(hid_t loc_id)
int retval = -1; /* return value */
/* Allocate write & read buffers */
- wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
+ wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
+ dwbuf = (int *)HDmalloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
/* Create dataspace for datasets */
if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0)
@@ -4742,10 +4742,10 @@ int write_attr_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc(2 * sizeof(int));
+ buf5[1].p = HDmalloc(2 * sizeof(int));
((int *)buf5[1].p)[0] = 2;
((int *)buf5[1].p)[1] = 3;
@@ -5062,7 +5062,7 @@ int write_attr_in(hid_t loc_id,
for (j = 0; j < 2; j++)
{
int l;
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = (size_t)(i + 1);
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
@@ -5528,7 +5528,7 @@ int write_attr_in(hid_t loc_id,
for (k = 0; k < 2; k++)
{
int l;
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = (size_t)i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)
@@ -6754,11 +6754,11 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* prepare vlen data
*/
vlen_objref_data[0].len = LEN0_VLEN_OBJREF;
- vlen_objref_data[0].p = malloc (vlen_objref_data[0].len * sizeof(hobj_ref_t));
+ vlen_objref_data[0].p = HDmalloc (vlen_objref_data[0].len * sizeof(hobj_ref_t));
vlen_objref_data[1].len = LEN1_VLEN_OBJREF;
- vlen_objref_data[1].p = malloc (vlen_objref_data[1].len * sizeof(hobj_ref_t));
+ vlen_objref_data[1].p = HDmalloc (vlen_objref_data[1].len * sizeof(hobj_ref_t));
vlen_objref_data[2].len = LEN2_VLEN_OBJREF;
- vlen_objref_data[2].p = malloc (vlen_objref_data[2].len * sizeof(hobj_ref_t));
+ vlen_objref_data[2].p = HDmalloc (vlen_objref_data[2].len * sizeof(hobj_ref_t));
/*
* create obj references
@@ -6823,7 +6823,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* prepare vlen data
*/
vlen_regref_data[0].len = LEN0_VLEN_REGREF;
- vlen_regref_data[0].p = malloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t));
+ vlen_regref_data[0].p = HDmalloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t));
/*
* create region reference