summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-01 20:14:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-01 20:14:11 (GMT)
commit4659f50b832958636db672d9025a610eb70b04f1 (patch)
tree4d6f3e9c523dcd89e1b6d1f07f3cf184a3b007a7 /src/H5Distore.c
parent1cd1d6956a9d00ea5eaf57fcfad87b2c8651cf9c (diff)
downloadhdf5-4659f50b832958636db672d9025a610eb70b04f1.zip
hdf5-4659f50b832958636db672d9025a610eb70b04f1.tar.gz
hdf5-4659f50b832958636db672d9025a610eb70b04f1.tar.bz2
[svn-r12189] Purpose:
New/expanded features Description: Check in Peter's changed for the object copy code: - Allow/fix copying datasets using named variable-length datatypes - Start adding framework for property list to control how object copying occurs. Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 8ab2527..bcf5fee 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -312,6 +312,9 @@ H5FL_SEQ_DEFINE_STATIC(size_t);
/* Declare a free list to manage the raw page information */
H5FL_BLK_DEFINE_STATIC(chunk_page);
+/* Declare extern the free list to manage blocks of type conversion data */
+H5FL_BLK_EXTERN(type_conv);
+
/*-------------------------------------------------------------------------
* Function: H5D_istore_get_shared
@@ -985,6 +988,7 @@ H5D_istore_iter_copy(H5F_t *f_src, hid_t dxpl_id, const void *_lt_key, haddr_t a
H5D_istore_it_ud4_t *udata = (H5D_istore_it_ud4_t *)_udata;
const H5D_istore_key_t *lt_key = (const H5D_istore_key_t *)_lt_key;
H5D_istore_ud1_t udata_dst; /* User data about new destination chunk */
+ void *bkg = NULL; /* Temporary buffer for copying data */
hbool_t is_vlen = FALSE;
/* General information about chunk copy */
@@ -1053,8 +1057,12 @@ H5D_istore_iter_copy(H5F_t *f_src, hid_t dxpl_id, const void *_lt_key, haddr_t a
/* Copy into another buffer, to reclaim memory later */
HDmemcpy(reclaim_buf, buf, reclaim_buf_size);
+ /* allocate temporary bkg buff for data conversion */
+ if(NULL == (bkg = H5FL_BLK_CALLOC(type_conv, buf_size)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5B_ITER_ERROR, "memory allocation failed")
+
/* Convert from memory to destination file */
- if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, NULL, dxpl_id) < 0)
+ if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5B_ITER_ERROR, "datatype conversion failed")
/* Reclaim space from variable length data */
@@ -1087,6 +1095,9 @@ H5D_istore_iter_copy(H5F_t *f_src, hid_t dxpl_id, const void *_lt_key, haddr_t a
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, H5B_ITER_ERROR, "unable to write raw data to file")
done:
+ if(bkg)
+ H5FL_BLK_FREE(type_conv, bkg);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_iter_copy() */