summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-04-30 06:10:38 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-04-30 06:10:38 (GMT)
commitbd33a9d6da4f56884eaf5dc750186a6c02c90446 (patch)
tree2bb71d0ed2ebbb447c28e8e77ecf55ce01340d9f /src/H5FDdirect.c
parentf63b2c50ac95fb8363a9b8143d3a3d5f50c58d35 (diff)
downloadhdf5-bd33a9d6da4f56884eaf5dc750186a6c02c90446.zip
hdf5-bd33a9d6da4f56884eaf5dc750186a6c02c90446.tar.gz
hdf5-bd33a9d6da4f56884eaf5dc750186a6c02c90446.tar.bz2
[svn-r29842] Description:
Bring [appropriate portions of] r29811, 29813, 29826, 29830, 29831 from revise_chunks branch to the trunk. Tested on: MacOSX/64 10.11.4 (amazon) w/serial, parallel & production (h5committest forthcoming)
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index f88fb1e..2034ba0 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -526,6 +526,9 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
* is to handle correctly the case that the file is in a different file system
* than the one where the program is running.
*/
+ /* NOTE: Use HDmalloc and HDfree here to ensure compatibility with
+ * HDposix_memalign.
+ */
buf1 = (int *)HDmalloc(sizeof(int));
if(HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
@@ -992,6 +995,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
addr = (haddr_t)(((addr + size - 1) / _fbsize + 1) * _fbsize);
if(copy_buf) {
+ /* Free with HDfree since it came from posix_memalign */
HDfree(copy_buf);
copy_buf = NULL;
} /* end if */
@@ -1003,6 +1007,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
done:
if(ret_value<0) {
+ /* Free with HDfree since it came from posix_memalign */
if(copy_buf)
HDfree(copy_buf);
@@ -1223,6 +1228,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
buf = (const char*)buf + size;
if(copy_buf) {
+ /* Free with HDfree since it came from posix_memalign */
HDfree(copy_buf);
copy_buf = NULL;
} /* end if */
@@ -1236,6 +1242,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
done:
if(ret_value<0) {
+ /* Free with HDfree since it came from posix_memalign */
if(copy_buf)
HDfree(copy_buf);