Skip to content
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

Use HDF5 memory management functions #10

Open
aparamon opened this issue Apr 11, 2018 · 1 comment
Open

Use HDF5 memory management functions #10

aparamon opened this issue Apr 11, 2018 · 1 comment
Labels

Comments

@aparamon
Copy link

Currently, external buffers are allocated via malloc()

if (NULL==(outBuf = malloc(origSize)))

if (NULL==(outBuf = malloc(LZ4_COMPRESSBOUND(nbytes)

and released by free()


It is sub-optimal though as this method requires the plugin to be compiled with the same memory manager as HDF5 library, which is sometimes non-trivial to achieve, esp. on Windows.

HDF5 memory management functions
https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-AllocateMemory
https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-FreeMemory
should be used instead.

@zjttoefs zjttoefs added the LZ4 label Apr 12, 2018
@zjttoefs
Copy link
Collaborator

That sounds like a very fair point and I also learned something. Thanks.
Would you maybe do a pull request after you've confirmed it works?
Change looks simple, but I've got little time for proper testing at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants