<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node.git/src/node_buffer.h, branch move-debugger-tests</title>
<subtitle>github.com: joyent/node.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/'/>
<entry>
<title>src: add multi-context support</title>
<updated>2013-09-06T03:51:42+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2013-08-10T22:26:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=756b6222956b5d25b2e7db81f4e79033a3a4d20e'/>
<id>756b6222956b5d25b2e7db81f4e79033a3a4d20e</id>
<content type='text'>
This commit makes it possible to use multiple V8 execution contexts
within a single event loop.  Put another way, handle and request wrap
objects now "remember" the context they belong to and switch back to
that context when the time comes to call into JS land.

This could have been done in a quick and hacky way by calling
v8::Object::GetCreationContext() on the wrap object right before
making a callback but that leaves a fairly wide margin for bugs.

Instead, we make the context explicit through a new Environment class
that encapsulates everything (or almost everything) that belongs to
the context.  Variables that used to be a static or a global are now
members of the aforementioned class.  An additional benefit is that
this approach should make it relatively straightforward to add full
isolate support in due course.

There is no JavaScript API yet but that will be added in the near
future.

This work was graciously sponsored by GitHub, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit makes it possible to use multiple V8 execution contexts
within a single event loop.  Put another way, handle and request wrap
objects now "remember" the context they belong to and switch back to
that context when the time comes to call into JS land.

This could have been done in a quick and hacky way by calling
v8::Object::GetCreationContext() on the wrap object right before
making a callback but that leaves a fairly wide margin for bugs.

Instead, we make the context explicit through a new Environment class
that encapsulates everything (or almost everything) that belongs to
the context.  Variables that used to be a static or a global are now
members of the aforementioned class.  An additional benefit is that
this approach should make it relatively straightforward to add full
isolate support in due course.

There is no JavaScript API yet but that will be added in the near
future.

This work was graciously sponsored by GitHub, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>src: move includes inside include guard</title>
<updated>2013-08-19T14:42:12+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2013-08-19T14:39:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=3e25ed905cff08cb450aa82b5383ffd9365cd7ae'/>
<id>3e25ed905cff08cb450aa82b5383ffd9365cd7ae</id>
<content type='text'>
Having the includes in src/node_buffer.h outside of the include guard
is not really harmful but it's inconsistent with other header files.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having the includes in src/node_buffer.h outside of the include guard
is not really harmful but it's inconsistent with other header files.
</pre>
</div>
</content>
</entry>
<entry>
<title>src: lint c++ code</title>
<updated>2013-07-31T18:12:06+00:00</updated>
<author>
<name>Fedor Indutny</name>
<email>fedor.indutny@gmail.com</email>
</author>
<published>2013-07-31T18:07:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=8e29ce9f13f7e4b6c0296325287c05f78ff22ce0'/>
<id>8e29ce9f13f7e4b6c0296325287c05f78ff22ce0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: write strings directly from call</title>
<updated>2013-06-19T20:15:05+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-06-19T20:07:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=f5e13ae9b5ca6eaacbcf9aad36552d9cd6c8bde6'/>
<id>f5e13ae9b5ca6eaacbcf9aad36552d9cd6c8bde6</id>
<content type='text'>
Buffer(&lt;String&gt;) used to pass the string to js where it would then be
passed back to cpp for processing. Now only the buffer object
instantiation is done in js and the string is processed in cpp.

Also added a Buffer api that also accepts the encoding.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Buffer(&lt;String&gt;) used to pass the string to js where it would then be
passed back to cpp for processing. Now only the buffer object
instantiation is done in js and the string is processed in cpp.

Also added a Buffer api that also accepts the encoding.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: proper API export for Windows</title>
<updated>2013-06-18T22:41:16+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-06-07T17:31:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=7373c4ddb7143fb7da75feda39c70788fb1bcfc7'/>
<id>7373c4ddb7143fb7da75feda39c70788fb1bcfc7</id>
<content type='text'>
So that Windows users can properly include smalloc and node_buffer,
NODE_EXTERN was added to the headers that export this functionality.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So that Windows users can properly include smalloc and node_buffer,
NODE_EXTERN was added to the headers that export this functionality.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: use smalloc as backing data store</title>
<updated>2013-06-18T22:39:13+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-04-17T23:26:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=3a2f273bd73bc94a6e93f342d629106a9f022f2d'/>
<id>3a2f273bd73bc94a6e93f342d629106a9f022f2d</id>
<content type='text'>
Memory allocations are now done through smalloc. The Buffer cc class has
been removed completely, but for backwards compatibility have left the
namespace as Buffer.

The .parent attribute is only set if the Buffer is a slice of an
allocation. Which is then set to the alloc object (not a Buffer).

The .offset attribute is now a ReadOnly set to 0, for backwards
compatibility. I'd like to remove it in the future (pre v1.0).

A few alterations have been made to how arguments are either coerced or
thrown. All primitives will now be coerced to their respective values,
and (most) all out of range index requests will throw.

The indexes that are coerced were left for backwards compatibility. For
example: Buffer slice operates more like Array slice, and coerces
instead of throwing out of range indexes. This may change in the future.

The reason for wanting to throw for out of range indexes is because
giving js access to raw memory has high potential risk. To mitigate that
it's easier to make sure the developer is always quickly alerted to the
fact that their code is attempting to access beyond memory bounds.

Because SlowBuffer will be deprecated, and simply returns a new Buffer
instance, all tests on SlowBuffer have been removed.

Heapdumps will now show usage under "smalloc" instead of "Buffer".

ParseArrayIndex was added to node_internals to support proper uint
argument checking/coercion for external array data indexes.

SlabAllocator had to be updated since handle_ no longer exists.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Memory allocations are now done through smalloc. The Buffer cc class has
been removed completely, but for backwards compatibility have left the
namespace as Buffer.

The .parent attribute is only set if the Buffer is a slice of an
allocation. Which is then set to the alloc object (not a Buffer).

The .offset attribute is now a ReadOnly set to 0, for backwards
compatibility. I'd like to remove it in the future (pre v1.0).

A few alterations have been made to how arguments are either coerced or
thrown. All primitives will now be coerced to their respective values,
and (most) all out of range index requests will throw.

The indexes that are coerced were left for backwards compatibility. For
example: Buffer slice operates more like Array slice, and coerces
instead of throwing out of range indexes. This may change in the future.

The reason for wanting to throw for out of range indexes is because
giving js access to raw memory has high potential risk. To mitigate that
it's easier to make sure the developer is always quickly alerted to the
fact that their code is attempting to access beyond memory bounds.

Because SlowBuffer will be deprecated, and simply returns a new Buffer
instance, all tests on SlowBuffer have been removed.

Heapdumps will now show usage under "smalloc" instead of "Buffer".

ParseArrayIndex was added to node_internals to support proper uint
argument checking/coercion for external array data indexes.

SlabAllocator had to be updated since handle_ no longer exists.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: DRY string encoding using StringBytes</title>
<updated>2013-05-14T20:51:42+00:00</updated>
<author>
<name>isaacs</name>
<email>i@izs.me</email>
</author>
<published>2013-05-02T17:44:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=119354f7356de47cb36b5a1cebf9423e89c7f10b'/>
<id>119354f7356de47cb36b5a1cebf9423e89c7f10b</id>
<content type='text'>
This also templatizes the Buffer::*Slice functions, and the template
function probably cannot be safely used outside of Node.  However, it
also SHOULD not be used outside of Node, so this is arguably a feature
as well as a caveat.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This also templatizes the Buffer::*Slice functions, and the template
function probably cannot be safely used outside of Node.  However, it
also SHOULD not be used outside of Node, so this is arguably a feature
as well as a caveat.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: optimize Buffer.prototype.write(s, 'hex')</title>
<updated>2013-02-02T00:01:42+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2013-02-01T23:40:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=cd42f56178c929da84046e750b9306b5656e3144'/>
<id>cd42f56178c929da84046e750b9306b5656e3144</id>
<content type='text'>
Move the implementation to C++ land. This is similar to commit 3f65916
but this time for the write() function and the Buffer(s, 'hex')
constructor.

Speeds up the benchmark below about 24x (2.6s vs 1:02m).

  var s = 'f';
  for (var i = 0; i &lt; 26; ++i) s += s;  // 64 MB
  Buffer(s, 'hex');
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the implementation to C++ land. This is similar to commit 3f65916
but this time for the write() function and the Buffer(s, 'hex')
constructor.

Speeds up the benchmark below about 24x (2.6s vs 1:02m).

  var s = 'f';
  for (var i = 0; i &lt; 26; ++i) s += s;  // 64 MB
  Buffer(s, 'hex');
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: optimize Buffer.prototype.toString('hex')</title>
<updated>2013-02-01T22:07:17+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2013-02-01T21:35:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=3f65916fa995c74b0db2064911fe76d18d3509b6'/>
<id>3f65916fa995c74b0db2064911fe76d18d3509b6</id>
<content type='text'>
Move the implementation to C++ land. The old JS implementation used
string concatenation, was dog slow and consumed copious amounts of
memory for large buffers. Example:

  var buf = Buffer(0x1000000);  // 16 MB
  buf.toString('hex')           // Used 3+ GB of memory.

The new implementation operates in O(n) time and space.

Fixes #4700.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the implementation to C++ land. The old JS implementation used
string concatenation, was dog slow and consumed copious amounts of
memory for large buffers. Example:

  var buf = Buffer(0x1000000);  // 16 MB
  buf.toString('hex')           // Used 3+ GB of memory.

The new implementation operates in O(n) time and space.

Fixes #4700.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: floating point read/write improvements</title>
<updated>2013-01-16T18:17:20+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2012-12-22T21:06:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=22b84e6216b86f9d5178e7d8a4d1a577209b7008'/>
<id>22b84e6216b86f9d5178e7d8a4d1a577209b7008</id>
<content type='text'>
Improvements:
* floating point operations are approx 4x's faster
* Now write quiet NaN's
* all read/write on floating point now done in C, so no more need for
  lib/buffer_ieee754.js
* float values have more accurate min/max value checks
* add additional benchmarks for buffers read/write
* created benchmark/_bench_timer.js which is a simple library that
  can be included into any benchmark and provides an intelligent tracker
  for sync and async tests
* add benchmarks for DataView set methods
* add checks and tests to make sure offset is greater than 0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improvements:
* floating point operations are approx 4x's faster
* Now write quiet NaN's
* all read/write on floating point now done in C, so no more need for
  lib/buffer_ieee754.js
* float values have more accurate min/max value checks
* add additional benchmarks for buffers read/write
* created benchmark/_bench_timer.js which is a simple library that
  can be included into any benchmark and provides an intelligent tracker
  for sync and async tests
* add benchmarks for DataView set methods
* add checks and tests to make sure offset is greater than 0
</pre>
</div>
</content>
</entry>
</feed>
