diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:30:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:30:06 (GMT) |
commit | 8b866d0e85adc5fcf9e19bffaea0b26d6c43ab68 (patch) | |
tree | 5517045188ed3b1dc389ce0ec4a5a54e33ed0bb3 | |
parent | acdd4e1d3facda67171d27d0e9f6ed8f3b65cf69 (diff) | |
download | hdf5-8b866d0e85adc5fcf9e19bffaea0b26d6c43ab68.zip hdf5-8b866d0e85adc5fcf9e19bffaea0b26d6c43ab68.tar.gz hdf5-8b866d0e85adc5fcf9e19bffaea0b26d6c43ab68.tar.bz2 |
[svn-r8942] 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
-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 e224fea..f9572b3 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1153,6 +1153,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 */ @@ -1395,7 +1396,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 */ @@ -1649,6 +1651,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 */ @@ -1999,7 +2002,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 */ |