diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-04-04 21:00:31 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-04-04 21:00:31 (GMT) |
commit | 02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4 (patch) | |
tree | 4b36327c0da85d62ea116da32d0f114700d0f6c9 /src/H5Zdeflate.c | |
parent | 7170bbbc96f2b29f42be53f8271fc359f617e09c (diff) | |
download | hdf5-02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4.zip hdf5-02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4.tar.gz hdf5-02e4ee5edf5d1c8fe285497def5cd7b7afbf77e4.tar.bz2 |
[svn-r2073] Added free-list code to the library and took out the older "temporary buffer"
code, since the functionality was superceded. See the followup document for
details on the free-list code.
Diffstat (limited to 'src/H5Zdeflate.c')
-rw-r--r-- | src/H5Zdeflate.c | 15 |
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); } |