Skip to content

Commit

Permalink
Docs: note use of free() for disposal of NewBuffer
Browse files Browse the repository at this point in the history
Should hopefully ease v2 upgrades - see nodejs#402
  • Loading branch information
lovell committed Aug 24, 2015
1 parent 14f0822 commit 02d262b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ NAN's `node::Buffer` helpers exist as the API has changed across supported Node

Allocate a new `node::Buffer` object with the specified size and optional data. Calls `node::Buffer::New()`.

Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management. You _must not_ free the memory space manually once you have created a `Buffer` in this way.
Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management.
`data` will be disposed of via a call to `free()`.
You _must not_ free the memory space manually once you have created a `Buffer` in this way.

Signature:

Expand Down

0 comments on commit 02d262b

Please sign in to comment.