<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node.git/doc/api/buffer.markdown, branch execSync-wip</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>buffer: add buf.toArrayBuffer() API</title>
<updated>2013-10-11T19:17:23+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-10-11T18:44:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=8a295cd520bf7fb0e4bf44b7451e1f1fe2456706'/>
<id>8a295cd520bf7fb0e4bf44b7451e1f1fe2456706</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: create separate module</title>
<updated>2013-07-19T20:36:13+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-07-12T22:18:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=d817843d2e0d8f9708620c76c471fc5e94f84264'/>
<id>d817843d2e0d8f9708620c76c471fc5e94f84264</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>src: enable native v8 typed arrays</title>
<updated>2013-07-06T15:44:45+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2013-06-29T06:16:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=0693d22f86de01b179343cc568a5609726bef9bb'/>
<id>0693d22f86de01b179343cc568a5609726bef9bb</id>
<content type='text'>
This commit removes our homegrown typed arrays implementation and
enables V8's built-in typed arrays implementation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit removes our homegrown typed arrays implementation and
enables V8's built-in typed arrays implementation.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: expose class methods alloc and dispose</title>
<updated>2013-06-18T22:39:32+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-05-15T18:01:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=fb40da822fa8bb6da588af1989aaf32ef01d0a17'/>
<id>fb40da822fa8bb6da588af1989aaf32ef01d0a17</id>
<content type='text'>
Expose the ability for users to allocate and manually dispose data on
any object. These are user-safe versions of internal smalloc functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Expose the ability for users to allocate and manually dispose data on
any object. These are user-safe versions of internal smalloc functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: reimplement Buffer pools</title>
<updated>2013-06-18T22:39:32+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-04-17T23:29:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=456942a920fe313ebe0b0da366d26ef400ec177e'/>
<id>456942a920fe313ebe0b0da366d26ef400ec177e</id>
<content type='text'>
While the new Buffer implementation is much faster we still have the
necessity of using Buffer pools. This is undesirable because it may
still lead to unwanted memory retention, but for the time being this is
the best solution.

Because of this re-introduction, and since there is no more SlowBuffer
type, the SlowBuffer method has been re-purposed to return a non-pooled
Buffer instance. This will be helpful for developers to store data for
indeterminate lengths of time without introducing a memory leak.

Another change to Buffer pools was that they are only allocated if the
requested chunk is &lt; poolSize / 2. This was done because allocations are
much quicker now, and it's a better use of the pool.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the new Buffer implementation is much faster we still have the
necessity of using Buffer pools. This is undesirable because it may
still lead to unwanted memory retention, but for the time being this is
the best solution.

Because of this re-introduction, and since there is no more SlowBuffer
type, the SlowBuffer method has been re-purposed to return a non-pooled
Buffer instance. This will be helpful for developers to store data for
indeterminate lengths of time without introducing a memory leak.

Another change to Buffer pools was that they are only allocated if the
requested chunk is &lt; poolSize / 2. This was done because allocations are
much quicker now, and it's a better use of the pool.
</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: change output of Buffer.prototype.toJSON()</title>
<updated>2013-03-30T20:52:22+00:00</updated>
<author>
<name>David Braun</name>
<email>NodeJS-box@snkmail.com</email>
</author>
<published>2013-03-26T15:14:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=840a29fc0fd256a63b3f2f5e7528de5107a608a3'/>
<id>840a29fc0fd256a63b3f2f5e7528de5107a608a3</id>
<content type='text'>
Expand the JSON representation of Buffer to include type information
so that it can be deserialized in JSON.parse() without context.

Fixes #5110.
Fixes #5143.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Expand the JSON representation of Buffer to include type information
so that it can be deserialized in JSON.parse() without context.

Fixes #5110.
Fixes #5143.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: remove _charsWritten</title>
<updated>2013-03-26T16:53:34+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-03-25T18:55:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=ccda6bb3ac99ee46508860385128f47a3d5547e5'/>
<id>ccda6bb3ac99ee46508860385128f47a3d5547e5</id>
<content type='text'>
_charsWritten is an internal property that was constantly written to,
but never read from. So it has been removed.

Removed documentation reference as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_charsWritten is an internal property that was constantly written to,
but never read from. So it has been removed.

Removed documentation reference as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>doc: update that ascii write doesn't convert null</title>
<updated>2013-03-21T17:54:17+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2013-03-21T17:50:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=f7ebb4d8b6d1ef68b1176b3f2ced87dd481316bf'/>
<id>f7ebb4d8b6d1ef68b1176b3f2ced87dd481316bf</id>
<content type='text'>
Since WriteBuffer has been replaced with WriteOneByte, writing ascii
will no longer automatically convert 0x0 to 0x20. So removed mention of
this special case from docs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since WriteBuffer has been replaced with WriteOneByte, writing ascii
will no longer automatically convert 0x0 to 0x20. So removed mention of
this special case from docs.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: strip high bits when converting to ascii</title>
<updated>2013-03-08T22:42:15+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2012-12-06T04:13:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=96a314b68b19277cc71ccac06b6517956b8f8a22'/>
<id>96a314b68b19277cc71ccac06b6517956b8f8a22</id>
<content type='text'>
Consider the following example:

  console.log(Buffer('ú').toString('ascii'));

Before this commit, the contents of the buffer was used as-is and hence it
prints 'ú'.

Now, it prints 'C:'. Perhaps not much of an improvement but it conforms to what
the documentation says it does: strip off the high bits.

Fixes #4371.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Consider the following example:

  console.log(Buffer('ú').toString('ascii'));

Before this commit, the contents of the buffer was used as-is and hence it
prints 'ú'.

Now, it prints 'C:'. Perhaps not much of an improvement but it conforms to what
the documentation says it does: strip off the high bits.

Fixes #4371.
</pre>
</div>
</content>
</entry>
</feed>
