smalloc: create separate module
authorTrevor Norris <trev.norris@gmail.com>
Fri, 12 Jul 2013 22:18:21 +0000 (15:18 -0700)
committerTrevor Norris <trev.norris@gmail.com>
Fri, 19 Jul 2013 20:36:13 +0000 (13:36 -0700)
commitd817843d2e0d8f9708620c76c471fc5e94f84264
tree851c3b27a7c449af850f303969df9218ec71fa71
parent46d11510ad6ea9a1fd9ffeafbe9e2345fabc8e93
smalloc: create separate module

It will be confusing if later on we add Buffer#dispose(), and smalloc is
its own cpp api anyways. So instead create a new require('smalloc') to
expose the previous Buffer.alloc/dispose methods, and expose copyOnto
and kMaxLength as well.

Other changes:
* Added documentation and additional tests.
* smalloc::CopyOnto has changed from using assert() to throwing errors
  on bad argument values because it is not exposed to the user.
* Minor style fixes.
doc/api/_toc.markdown
doc/api/all.markdown
doc/api/buffer.markdown
doc/api/smalloc.markdown [new file with mode: 0644]
lib/buffer.js
lib/smalloc.js [new file with mode: 0644]
node.gyp
src/smalloc.cc
test/simple/test-buffer.js
test/simple/test-smalloc.js