diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:30:04 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:30:04 (GMT) |
commit | b015e55614aa4780806e9515a4a35bea76fa09bf (patch) | |
tree | b730f5b102a889ef8a9e15093ace051cadfd575a /src/H5Dio.c | |
parent | 375f0745a7a07cf430d92a755297e372b3a4b420 (diff) | |
download | hdf5-b015e55614aa4780806e9515a4a35bea76fa09bf.zip hdf5-b015e55614aa4780806e9515a4a35bea76fa09bf.tar.gz hdf5-b015e55614aa4780806e9515a4a35bea76fa09bf.tar.bz2 |
[svn-r8941] Purpose:
Code optimization
Description:
Changed calloc() calls to malloc() calls allocating background buffers
during dataset writes, since the background buffer information will be read
from disk anyway, overwriting any existing values.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.10 (sleipnir) w/parallel
Too minor to require h5committest
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r-- | src/H5Dio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 5c84efe..a480209 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1206,6 +1206,7 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, } /* end if */ if (need_bkg && NULL==(bkg_buf=dxpl_cache->bkgr_buf)) { /* Allocate background buffer */ + /* (Need calloc()-like call since memory needs to be initialized) */ if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") } /* end if */ @@ -1455,7 +1456,8 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, } /* end if */ if (need_bkg && NULL==(bkg_buf=dxpl_cache->bkgr_buf)) { /* Allocate background buffer */ - if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) + /* (Don't need calloc()-like call since file data is already initialized) */ + if((bkg_buf=H5FL_BLK_MALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") } /* end if */ @@ -1716,6 +1718,7 @@ H5D_chunk_read(hsize_t nelmts, H5D_t *dataset, } /* end if */ if (need_bkg && NULL==(bkg_buf=dxpl_cache->bkgr_buf)) { /* Allocate background buffer */ + /* (Need calloc()-like call since memory needs to be initialized) */ if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") } /* end if */ @@ -2073,7 +2076,8 @@ H5D_chunk_write(hsize_t nelmts, H5D_t *dataset, } /* end if */ if (need_bkg && NULL==(bkg_buf=dxpl_cache->bkgr_buf)) { /* Allocate background buffer */ - if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) + /* (Don't need calloc()-like call since file data is already initialized) */ + if((bkg_buf=H5FL_BLK_MALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") } /* end if */ |