Skip to content

Commit

Permalink
buffer: backport new buffer constructor APIs to v4.x
Browse files Browse the repository at this point in the history
This backports the new `Buffer.alloc()`, `Buffer.allocUnsafe()`,
`Buffer.from()`, and `Buffer.allocUnsafeSlow()` APIs for v4.

Some backported tests are disabled, but those are not related to the
new API.

Note that `Buffer.from(arrayBuffer[, byteOffset [, length]])` is not
supported in v4.x, only `Buffer.from(arrayBuffer)` is.

Refs: #4682
Refs: #5833
Refs: #7475
PR-URL: #7562
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
  • Loading branch information
ChALkeR authored and Myles Borins committed Jul 8, 2016
1 parent 9ef71ab commit 34776ec
Show file tree
Hide file tree
Showing 5 changed files with 1,902 additions and 1 deletion.
Loading

1 comment on commit 34776ec

@ChALkeR
Copy link
Member Author

@ChALkeR ChALkeR commented on 34776ec Jul 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also Reviewed-By: Rod Vagg <rod@vagg.org> in #7562 (comment).

Please sign in to comment.