Reject negative offsets in SlowBuffer::MakeFastBuffer(), it allows the creation of buffers that point to arbitrary addresses. Reported by Trevor Norris.
Make buffers report the proper retained size in heap snapshots. Before this commit, Buffer objects would show up in the heap profiler as being only a few hundred bytes large, even if the actual buffer was many megabytes.
String::Utf8Value and String::AsciiValue constructors take Handle<Value> So no need to convert to Handle<String>
Throw, don't abort. `new Buffer(0x3fffffff + 1)` used to bring down the process with the following error message: FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length exceeds max acceptable value Fixes #2280.
Conflicts: ChangeLog deps/v8/src/version.cc deps/v8/tools/gyp/v8.gyp doc/about/index.html doc/community/index.html doc/index.html doc/logos/index.html doc/template.html lib/path.js lib/querystring.js src/node_version.h
It was decided that the performance benefits that isolates offer (faster spin-up times for worker processes, faster inter-worker communication, possibly a lower memory footprint) are not actual bottlenecks for most people and do not outweigh the potential stability issues and intrusive changes to the code base that first-class support for isolates requires. Hence, this commit backs out all isolates-related changes. Good bye, isolates. We hardly knew ye.
The base64 decoder would intermittently throw an out-of-bounds exception when the buffer in `buf.write('', 'base64')` was a zero-sized buffer located at the end of the slab. Fixes #2657.
Honor the length argument in `buf.write(s, 0, buf.length, 'base64')`. Before this commit, the length argument was ignored. The decoder would keep writing until it hit the end of the buffer. Since most buffers in Node are slices of a parent buffer (the slab), this bug would overwrite the content of adjacent buffers. The bug is trivially demonstrated with the following test case: var assert = require('assert'); var a = Buffer(3); var b = Buffer('xxx'); a.write('aaaaaaaa', 'base64'); assert.equal(b.toString(), 'xxx'); This commit coincidentally also fixes a bug where Buffer._charsWritten was not updated for zero length buffers.