buffer: always allocate typed arrays outside heap
authorTrevor Norris <trev.norris@gmail.com>
Wed, 16 Sep 2015 04:14:18 +0000 (22:14 -0600)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Wed, 16 Sep 2015 15:41:00 +0000 (11:41 -0400)
commit4b4cfa2d44da199855dea7fd114890b7e4f98583
tree2582fa897fd110dc214ffd6475412102e54d2f08
parent7df018a29bf7619d8d979d0db821d97f16e5550f
buffer: always allocate typed arrays outside heap

By default v8 allocates typed arrays <= 64 bytes inside the v8 heap. In
these cases the memory pointer returned by Buffer::Data() can change
while the memory is being operated on. Resolve by passing a flag that
forces all typed arrays outside the v8 heap.

Fixes: 74178a5 "buffer: construct Uint8Array in JS"
PR-URL: https://github.com/nodejs/node/pull/2893
Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/node.cc