Re:Node Streams: How do they work?
by mjor on Wednesday April 18, 2012 @05:14AM
(#3857114)
Node.js Buffers are actually built on top of V8's Uint8Array. Using 32-bit integers to represent 8-bit values seems quite wasteful.
[ Parent
| on HN ]
Source please? The docs say a Buffer is "outside the V8 heap".
Yes, the chunk of memory is managed by node, but each Buffer instance is linked with a slice of the heap through `v8::Object->SetIndexedPropertiesToExternalArrayData()`, the same way a JS `Uint8Array` would.
Here's the relevant link: https://github.com/joyent/node/blob/master/src/node_buffer.c....