-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for memory allocation and freeing #21
base: master
Are you sure you want to change the base?
Conversation
Replace malloc() and free() with H5allocate_memory and H5free(), this is the correct way to do it according to HDF5 group.
Export BLOSC_FILTER.
The linux travis failures look like real build failures:
|
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:
I don't know what those 2 jobs are supposed to do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable and correct to me, however I have not done c++ regularly in a while.
It looks like the mac and windows CI has never passed.
@@ -228,8 +227,6 @@ size_t blosc_filter(unsigned flags, size_t cd_nelmts, | |||
/* declare dummy variables */ | |||
size_t cbytes, blocksize; | |||
|
|||
free(outbuf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just verifying that when we get here outbuf
will always be NULL
so free
was a no-op?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it appears not to be needed.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing me review to request-changes due to @MarkRivers 's comment about HDF5 group's internal discussions.
Ping. I plan to do a release soon, and I am curious if this is still valid or not. |
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.