- 
                Notifications
    You must be signed in to change notification settings 
- Fork 45
Closed
Description
One thing I noticed reading the ZipFile source is that there's some places where GC.@preserve should be used to preserve buffers in use by Zlib, but which are currently missing.
This kind of thing can lead to memory corruption if the GC frees the buffer while zlib is using it (and could ultimately lead to things like #66 and #51).
Basically, whenever you take a pointer to a buffer using pointer(), it's important that you explicitly preserve the Julia object which owns that memory, because Julia can't tell this needs to happen on its own. (Really, Base.pointer() should be deprecated and renamed unsafe_convert or at least unsafe_pointer, because dereferencing the value returned from it is unsafe without extra care!)
Metadata
Metadata
Assignees
Labels
No labels