Zero-copy buffers for binding external libraries #304

0 commits merged into from Oct 22, 2010


None yet
1 participant

The gist of these changes is to add a zero-copy interface to Buffer, for binding external libraries that do their own allocation. An example of such a library is ØMQ.

The addition is an alternate public constructor Buffer::New, that takes a data pointer and callback to call once the buffer is done with said data. The optional hint parameter is simply passed verbatim to the callback, for its own use.

Besides that, I've also gathered a small number of other Buffer-related changes here:

  • Replace *PixelData calls with *ArrayData calls, to be consistent everywhere.
  • Generalized copy method, which can now target any ArrayData-like object.
  • Cleaned up some old cruft that was left around after fast-buffers was merged.

Tests pass with flying colors.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment