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.
1 file changed
tree: 59836045e2b7d3e43111b59354d9ccc7431c0c7e
  1. c_src/
  2. src/
  3. test/
  4. .gitignore
  5. .travis.yml
  6. Makefile
  7. README.md
  8. rebar.config
  9. rebar.config.script
README.md

snappy-erlang-nif

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.

site

https://github.com/fdmanana/snappy-erlang-nif

performance tests

Snappy is much faster than zlib's deflate compression, specially for reasonably large amounts of data. Here follow a few basic tests.