mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r14262] Description:
Correct "off by one" error in computing the size of block to allocate when the I/O size is less than the memory block size. Tested on: Customer machines, by local developer...
This commit is contained in:
parent
bff2b14a05
commit
be3ccfa47d
@ -976,7 +976,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
|
||||
* copy buffer size. Make a bigger buffer for aligned I/O if size is
|
||||
* smaller than maximal copy buffer. */
|
||||
if(size < _cbsize)
|
||||
alloc_size = (size / _fbsize + 1) * _fbsize + _fbsize;
|
||||
alloc_size = ((size / _fbsize) * _fbsize) + _fbsize;
|
||||
else
|
||||
alloc_size = _cbsize;
|
||||
if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0)
|
||||
@ -1141,7 +1141,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
|
||||
* smaller than maximal copy buffer.
|
||||
*/
|
||||
if(size < _cbsize)
|
||||
alloc_size = (size / _fbsize + 1) * _fbsize + _fbsize;
|
||||
alloc_size = ((size / _fbsize) * _fbsize) + _fbsize;
|
||||
else
|
||||
alloc_size = _cbsize;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user