diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2010-05-25 20:39:52 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2010-05-25 20:39:52 (GMT) |
commit | 3f837fc3236a7f55004778e4f22f6e12f26c0b70 (patch) | |
tree | 489b7a248f0dd0b7ae9467a7585fa71365799525 /src/H5Dfill.c | |
parent | ef292895e9817f7134da9d4a6c7c0c699e01ae9e (diff) | |
download | hdf5-3f837fc3236a7f55004778e4f22f6e12f26c0b70.zip hdf5-3f837fc3236a7f55004778e4f22f6e12f26c0b70.tar.gz hdf5-3f837fc3236a7f55004778e4f22f6e12f26c0b70.tar.bz2 |
[svn-r18894] Purpose: Improve allocation performance of filtered datasets with non-default VL
fill values.
Description:
Previously, H5D_chunk_allocate would, if a dataset were filtered and had a non-default VL fill value, allocate a new buffer for every chunk. Changed
H5D_chunk_allocate to reuse the existing buffer if possible. Also other
miscellaneous cleanup.
Tested: jam, linew, amani (h5committest)
Diffstat (limited to 'src/H5Dfill.c')
-rw-r--r-- | src/H5Dfill.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 1db2976..1929a5a 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -363,7 +363,6 @@ done: */ herr_t H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, - hbool_t alloc_vl_during_refill, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, @@ -386,7 +385,6 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, fb_info->fill = fill; fb_info->file_type = dset_type; fb_info->file_tid = dset_type_id; - fb_info->alloc_vl_during_refill = alloc_vl_during_refill; fb_info->fill_alloc_func = alloc_func; fb_info->fill_alloc_info = alloc_info; fb_info->fill_free_func = free_func; @@ -434,16 +432,12 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, fb_info->use_caller_fill_buf = TRUE; } /* end if */ else { - if(alloc_vl_during_refill) - fb_info->fill_buf = NULL; - else { - if(alloc_func) - fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); - else - fb_info->fill_buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); - if(NULL == fb_info->fill_buf) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer") - } /* end else */ + if(alloc_func) + fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); + else + fb_info->fill_buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); + if(NULL == fb_info->fill_buf) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer") } /* end else */ /* Get the datatype conversion path for this operation */ @@ -577,16 +571,7 @@ H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) /* Check args */ HDassert(fb_info); HDassert(fb_info->has_vlen_fill_type); - - /* Check if we should allocate the fill buffer now */ - if(fb_info->alloc_vl_during_refill) { - if(fb_info->fill_alloc_func) - fb_info->fill_buf = fb_info->fill_alloc_func(fb_info->fill_buf_size, fb_info->fill_alloc_info); - else - fb_info->fill_buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); - if(NULL == fb_info->fill_buf) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer") - } /* end if */ + HDassert(fb_info->fill_buf); /* Make a copy of the (disk-based) fill value into the buffer */ HDmemcpy(fb_info->fill_buf, fb_info->fill->buf, fb_info->file_elmt_size); |