summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
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/h5diff
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/h5diff')
-rw-r--r--tools/h5diff/h5diff_common.c2
-rw-r--r--tools/h5diff/h5diffgentest.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index cf46e74..59cab0d 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -174,7 +174,7 @@ void parse_command_line(int argc,
options->exclude_path = 1;
/* create linked list of excluding objects */
- if( (exclude_node = (struct exclude_path_list*) malloc(sizeof(struct exclude_path_list))) == NULL)
+ if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL)
{
printf("Error: lack of memory!\n");
h5diff_exit(EXIT_FAILURE);
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index d7389d3..d554abd 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -4475,7 +4475,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a
for(i=0; i<SDIM_DSET; i++)
{
wdata[i].i1 = i;
- wdata[i].vl.p = malloc((i+1)*sizeof(cmpd2_t));
+ wdata[i].vl.p = HDmalloc((i+1)*sizeof(cmpd2_t));
wdata[i].vl.len = i+1;
for(j=0; j<(i+1); j++)
{
@@ -4600,7 +4600,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch
for(j=0; j < SDIM_CMPD_ARRAY; j++)
{
wdata[i].cmpd2[j].i2 = j*10;
- wdata[i].cmpd2[j].vl.p = malloc((j+1)*sizeof(cmpd3_t));
+ wdata[i].cmpd2[j].vl.p = HDmalloc((j+1)*sizeof(cmpd3_t));
wdata[i].cmpd2[j].vl.len = j+1;
for(k=0; k<(j+1); k++)
{
@@ -4744,7 +4744,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch
{
/* compound 1 data */
wdata[i].i1 = i;
- wdata[i].vl.p = malloc((i+1)*sizeof(cmpd2_t));
+ wdata[i].vl.p = HDmalloc((i+1)*sizeof(cmpd2_t));
wdata[i].vl.len = i+1;
for(j=0; j<(i+1); j++)
{
@@ -5456,10 +5456,10 @@ void 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;
@@ -5743,7 +5743,7 @@ void write_attr_in(hid_t loc_id,
n=0;
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
@@ -6159,7 +6159,7 @@ void write_attr_in(hid_t loc_id,
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 2; k++) {
- 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 = i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0;
@@ -6490,10 +6490,10 @@ void 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;
@@ -6703,7 +6703,7 @@ void write_dset_in(hid_t loc_id,
{
for(j = 0; j < 2; j++)
{
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
for(l = 0; l < i + 1; l++)
{
@@ -6916,7 +6916,7 @@ void write_dset_in(hid_t loc_id,
{
for(k = 0; k < 2; k++)
{
- 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 = i + 1;
for(l = 0; l < i + 1; l++)
{