commit | 2038ad13b1d6926468f25adea110028e3c0b4b0c | [log] [tgz] |
---|---|---|
author | Paul J. Davis <paul.joseph.davis@gmail.com> | Tue Oct 16 11:07:58 2018 -0500 |
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | Tue Oct 16 11:07:58 2018 -0500 |
tree | 59836045e2b7d3e43111b59354d9ccc7431c0c7e | |
parent | 60572a1a4a9fe3cf4e97ccf14df100080481791a [diff] |
Fix memory bug in SnappyNifSink::Append Previously `SnappyNifSink` assumed that `GetAppendBuffer` was always called before `Append`. This turned out to be an invalid assumption. This was definitely in the land of "How did that even work?". The simple fix is simple. This also pre-allocates the write buffer to 8192 bytes which just saves us from the initial re-allocation on first `Append` since we allocated a zero length buffer initially.
This is an Erlang NIF for Google's snappy fast compressor and decompressor.
Google snappy's official repository and bug tracking system is at:
Its source is included in this project.
https://github.com/fdmanana/snappy-erlang-nif
Snappy is much faster than zlib's deflate compression, specially for reasonably large amounts of data. Here follow a few basic tests.