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 #402
  • Loading branch information
lovell authored and kkoopa committed Aug 25, 2015
1 parent 80af845 commit 325c24e
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.
When a `node::Buffer` instance is garbage collected and a `FreeCallback` has not been specified, `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 325c24e

Please sign in to comment.