summaryrefslogtreecommitdiffstats
path: root/src/H5Zdeflate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Zdeflate.c')
-rw-r--r--src/H5Zdeflate.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index a764c4b..5f523f5 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -66,7 +66,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
z_stream z_strm;
size_t nalloc = *buf_size;
- if (NULL==(outbuf = H5MM_malloc(nalloc))) {
+ if (NULL==(outbuf = H5F_istore_chunk_alloc(nalloc))) {
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0,
"memory allocation failed for deflate uncompression");
}
@@ -87,7 +87,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
}
if (Z_OK==status && 0==z_strm.avail_out) {
nalloc *= 2;
- if (NULL==(outbuf = H5MM_realloc(outbuf, nalloc))) {
+ if (NULL==(outbuf = H5F_istore_chunk_realloc(outbuf, nalloc))) {
inflateEnd(&z_strm);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0,
"memory allocation failed for deflate "
@@ -98,7 +98,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
}
}
- H5MM_xfree(*buf);
+ H5F_istore_chunk_free(*buf);
*buf = outbuf;
outbuf = NULL;
*buf_size = nalloc;
@@ -116,7 +116,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
uLongf z_dst_nbytes = (uLongf)nbytes;
uLong z_src_nbytes = (uLong)nbytes;
- if (NULL==(z_dst=outbuf=H5MM_malloc(nbytes))) {
+ if (NULL==(z_dst=outbuf=H5F_istore_chunk_alloc(nbytes))) {
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0,
"unable to allocate deflate destination buffer");
}
@@ -129,7 +129,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
} else if (Z_OK!=status) {
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, 0, "deflate error");
} else {
- H5MM_xfree(*buf);
+ H5F_istore_chunk_free(*buf);
*buf = outbuf;
outbuf = NULL;
*buf_size = nbytes;
@@ -141,7 +141,8 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
"hdf5 was not compiled with zlib-1.0.2 or better");
#endif
- done:
- H5MM_xfree(outbuf);
+done:
+ if(outbuf)
+ H5F_istore_chunk_free(outbuf);
FUNC_LEAVE (ret_value);
}