summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-07-14 16:53:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-07-14 16:53:51 (GMT)
commit20a85b0e236a235b5a46fd02b4e96ea0574a1174 (patch)
tree827ed355d62a9ccd1b185c95a95ed7c052b699cc
parent320499b91c6c9745db77c6ab5e45f95d08f15239 (diff)
downloadhdf5-20a85b0e236a235b5a46fd02b4e96ea0574a1174.zip
hdf5-20a85b0e236a235b5a46fd02b4e96ea0574a1174.tar.gz
hdf5-20a85b0e236a235b5a46fd02b4e96ea0574a1174.tar.bz2
[svn-r7218] Purpose:
Bug fix Description: H5T_BKG_TEMP was accidentally removed from library code, but is used by application's datatype conversion routines. Solution: Revert removal of H5T_BKG_TEMP. Platforms tested: h5committest
-rw-r--r--release_docs/RELEASE.txt3
-rw-r--r--src/H5Dio.c32
-rw-r--r--src/H5Tconv.c6
-rw-r--r--src/H5Tpublic.h3
4 files changed, 23 insertions, 21 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 1efecf8..8ec9402 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -55,7 +55,8 @@ Bug Fixes since HDF5-1.6.0 release
Library
-------
-
+ - Returned H5T_BKG_TEMP support to library after it was accidentally
+ removed. (2003/07/14 - QAK)
Configuration
-------------
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 33ea366..9457ba9 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -1080,7 +1080,7 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S
if (need_bkg && NULL==(bkg_buf=H5P_peek_voidp(dx_plist,H5D_XFER_BKGR_BUF_NAME))) {
/* Allocate background buffer */
H5_CHECK_OVERFLOW((request_nelmts*dst_type_size),hsize_t,size_t);
- if((bkg_buf=H5FL_BLK_MALLOC(type_conv,(size_t)(request_nelmts*dst_type_size)))==NULL)
+ if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(size_t)(request_nelmts*dst_type_size)))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion");
} /* end if */
@@ -1113,7 +1113,7 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S
if (n!=smine_nelmts)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed");
- if (need_bkg) {
+ if (H5T_BKG_YES==need_bkg) {
#ifdef H5S_DEBUG
H5_timer_begin(&timer);
#endif
@@ -1307,15 +1307,15 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5
* malloc() is usually less resource-intensive if we allocate/free the
* same size over and over.
*/
- if (H5T_path_bkg(tpath)) {
+ if(H5T_detect_class(dataset->type, H5T_VLEN)) {
+ /* Old data is retrieved into background buffer for VL datatype. The
+ * data is used later for freeing heap objects. */
+ need_bkg = H5T_BKG_YES;
+ } else if (H5T_path_bkg(tpath)) {
/* Retrieve the bkgr buffer property */
if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type");
need_bkg = MAX (H5T_path_bkg(tpath), need_bkg);
- } else if(H5T_detect_class(dataset->type, H5T_VLEN)) {
- /* Old data is retrieved into background buffer for VL datatype. The
- * data is used later for freeing heap objects. */
- need_bkg = H5T_BKG_YES;
} else {
need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/
} /* end else */
@@ -1355,7 +1355,7 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5
if (n!=smine_nelmts)
HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed");
- if (need_bkg) {
+ if (H5T_BKG_YES==need_bkg) {
#ifdef H5S_DEBUG
H5_timer_begin(&timer);
#endif
@@ -1614,7 +1614,7 @@ UNUSED
if (need_bkg && NULL==(bkg_buf=H5P_peek_voidp(dx_plist,H5D_XFER_BKGR_BUF_NAME))) {
/* Allocate background buffer */
H5_CHECK_OVERFLOW((request_nelmts*dst_type_size),hsize_t,size_t);
- if((bkg_buf=H5FL_BLK_MALLOC(type_conv,(size_t)(request_nelmts*dst_type_size)))==NULL)
+ if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(size_t)(request_nelmts*dst_type_size)))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion");
} /* end if */
@@ -1685,7 +1685,7 @@ UNUSED
if (n!=smine_nelmts)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed");
- if (need_bkg) {
+ if (H5T_BKG_YES==need_bkg) {
#ifdef H5S_DEBUG
H5_timer_begin(&timer);
#endif
@@ -1994,15 +1994,15 @@ nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* malloc() is usually less resource-intensive if we allocate/free the
* same size over and over.
*/
- if (H5T_path_bkg(tpath)) {
+ if(H5T_detect_class(dataset->type, H5T_VLEN)) {
+ /* Old data is retrieved into background buffer for VL datatype. The
+ * data is used later for freeing heap objects. */
+ need_bkg = H5T_BKG_YES;
+ } else if (H5T_path_bkg(tpath)) {
/* Retrieve the bkgr buffer property */
if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type");
need_bkg = MAX (H5T_path_bkg(tpath), need_bkg);
- } else if(H5T_detect_class(dataset->type, H5T_VLEN)) {
- /* Old data is retrieved into background buffer for VL datatype. The
- * data is used later for freeing heap objects. */
- need_bkg = H5T_BKG_YES;
} else {
need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/
} /* end else */
@@ -2081,7 +2081,7 @@ nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
if (n!=smine_nelmts)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed");
- if (need_bkg) {
+ if (H5T_BKG_YES==need_bkg) {
#ifdef H5S_DEBUG
H5_timer_begin(&timer);
#endif
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index ab4ef71..c9329bd 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -2240,7 +2240,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
}
/* Check if we need a temporary buffer for this conversion */
- if(tpath->cdata.need_bkg||H5T_detect_class(dst->parent,H5T_VLEN)) {
+ if(tpath->cdata.need_bkg || H5T_detect_class(dst->parent,H5T_VLEN)) {
/* Set up initial background buffer */
tmp_buf_size=MAX(src_base_size,dst_base_size);
if ((tmp_buf=H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))==NULL)
@@ -2276,8 +2276,8 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
/* Check if temporary buffer is large enough, resize if necessary */
/* (Chain off the conversion buffer size) */
- if((tpath->cdata.need_bkg||H5T_detect_class(dst->parent,
- H5T_VLEN)) && tmp_buf_size<conv_buf_size) {
+ if((tpath->cdata.need_bkg || H5T_detect_class(dst->parent, H5T_VLEN))
+ && tmp_buf_size<conv_buf_size) {
/* Set up initial background buffer */
tmp_buf_size=conv_buf_size;
if((tmp_buf=H5FL_BLK_REALLOC(vlen_seq,tmp_buf,tmp_buf_size))==NULL)
diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h
index 8bea043..b9902d1 100644
--- a/src/H5Tpublic.h
+++ b/src/H5Tpublic.h
@@ -141,7 +141,8 @@ typedef enum H5T_cmd_t {
/* How is the `bkg' buffer used by the conversion function? */
typedef enum H5T_bkg_t {
H5T_BKG_NO = 0, /*background buffer is not needed, send NULL */
- H5T_BKG_YES = 1 /*init bkg buf with data before conversion */
+ H5T_BKG_TEMP = 1, /*bkg buffer used as temp storage only */
+ H5T_BKG_YES = 2 /*init bkg buf with data before conversion */
} H5T_bkg_t;
/* Type conversion client data */