hdf5-blosc icon indicating copy to clipboard operation
hdf5-blosc copied to clipboard

Fixes for memory allocation and freeing

Open MarkRivers opened this issue 5 years ago • 4 comments

This PR replaces calls to malloc() and free() with H5allocate_memory() and H5free_memory(). This is the correct mechanism according to HDF5 Group.

It also simplifies blosc_plugin.c, removes blosc_plugin.h, and does some other minor improvements.

MarkRivers avatar May 09 '19 13:05 MarkRivers

The linux travis failures look like real build failures:

/home/travis/build/Blosc/hdf5-blosc/src/blosc_filter.c:209:45: error: ‘false’ undeclared (first use in this function)
     outbuf = H5allocate_memory(outbuf_size, false);

tacaswell avatar May 10 '19 16:05 tacaswell

The builds were failing because "false" was not defined. It built OK on my local system, but not on travis. I changed "false" to 0, and then the first 2 Travis jobs completed OK. The next 2 jobs still fail, but simply because apt-get is not defined:

0.04s$ sudo apt-get install libhdf5-serial-dev
sudo: apt-get: command not found
The command "sudo apt-get install libhdf5-serial-dev" failed and exited with 1 during .
Your build has been stopped.

I don't know what those 2 jobs are supposed to do.

MarkRivers avatar May 10 '19 18:05 MarkRivers

Please don't merge this yet. The HDF5 Group developers are in internal discussions about how filter plugins should be doing memory allocation. I was told that using H5allocate_memory() and H5free_memory() is the correct way to do it, but now it seems that they are not sure about this.

MarkRivers avatar May 10 '19 19:05 MarkRivers

Ping. I plan to do a release soon, and I am curious if this is still valid or not.

FrancescAlted avatar Jun 06 '24 11:06 FrancescAlted