This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Based off of http://sambro.is-super-awesome.com/2011/03/03/creating-a-proper-buffer-in-a-node-c-addon/ | |
*/ | |
static Local<Object> makeBuffer(char* data, size_t size) { | |
HandleScope scope; | |
// It ends up being kind of a pain to convert a slow buffer into a fast | |
// one since the fast part is implemented in JavaScript. | |
Local<Buffer> slowBuffer = Buffer::New(data, size); | |
// First get the Buffer from global scope... |
NewerOlder