Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Conversation

@stephank
Copy link

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 pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant