buffer: add NativeBuffer API
authorTrevor Norris <trev.norris@gmail.com>
Mon, 26 Aug 2013 10:20:23 +0000 (03:20 -0700)
committerTrevor Norris <trev.norris@gmail.com>
Mon, 26 Aug 2013 21:12:00 +0000 (14:12 -0700)
commit16a60ed2a39f0fd2d772a923697488582fe9ffba
treec5047f6f66ae95003c89c56db4c22aab395a3bd6
parent9ac75d1f06d0bdbd7b4b3cecadc2e2d651779d9f
buffer: add NativeBuffer API

Due to a lot of the util.is* checks there was much unnecessary overhead
for the most common use case of Buffer. Which is creating a new Buffer
instance for data from incoming I/O. NativeBuffer is a simple way to
bypass all the unneeded checks and simply hand back a Buffer instance
while setting the length.
lib/buffer.js
src/node_buffer.cc