<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node.git/src/smalloc.cc, branch master</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>smalloc: extend user API</title>
<updated>2015-02-20T22:19:30+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2015-02-20T17:32:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=9deade432254ebb39a6afb468fad5586d24a5b50'/>
<id>9deade432254ebb39a6afb468fad5586d24a5b50</id>
<content type='text'>
node::Environment isn't accessible to user APIs, so extend smalloc to
also accept v8::Isolate.

Fixes: 75adde07 "src: remove `node_isolate` from source"
PR-URL: https://github.com/iojs/io.js/pull/905
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
node::Environment isn't accessible to user APIs, so extend smalloc to
also accept v8::Isolate.

Fixes: 75adde07 "src: remove `node_isolate` from source"
PR-URL: https://github.com/iojs/io.js/pull/905
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: fix bad assert for zero length data</title>
<updated>2015-01-05T10:24:40+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2015-01-05T10:20:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=372a2f56bed341a23c435c5a94fbb77dbbd6c600'/>
<id>372a2f56bed341a23c435c5a94fbb77dbbd6c600</id>
<content type='text'>
If the data length passed to smalloc.alloc() the array_length will be
zero, causing an overflow check to fail. This prevents that from
happening.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the data length passed to smalloc.alloc() the array_length will be
zero, causing an overflow check to fail. This prevents that from
happening.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: don't allow to dispose typed arrays</title>
<updated>2014-11-26T20:39:02+00:00</updated>
<author>
<name>Vladimir Kurchatkin</name>
<email>vladimir.kurchatkin@gmail.com</email>
</author>
<published>2014-11-18T09:30:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=bf3e0f417bbf4ba749730a76dd36a3e59d44da3e'/>
<id>bf3e0f417bbf4ba749730a76dd36a3e59d44da3e</id>
<content type='text'>
PR-URL: https://github.com/joyent/node/pull/8743
Reviewed-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/joyent/node/pull/8743
Reviewed-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: fix copyOnto optimization</title>
<updated>2014-10-30T22:49:02+00:00</updated>
<author>
<name>Vladimir Kurchatkin</name>
<email>vladimir.kurchatkin@gmail.com</email>
</author>
<published>2014-10-28T12:32:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=849fcdeca05a67e656f9f2c82eef194ff6f97231'/>
<id>849fcdeca05a67e656f9f2c82eef194ff6f97231</id>
<content type='text'>
copyOnto is broken when one argument has 1 byte size and the other &gt; 1
byte.

PR-URL: https://github.com/joyent/node/pull/8637
Reviewed-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
copyOnto is broken when one argument has 1 byte size and the other &gt; 1
byte.

PR-URL: https://github.com/joyent/node/pull/8637
Reviewed-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: update use of ExternalArrayType constants</title>
<updated>2014-10-08T08:34:46+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-10-08T08:34:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=bdc2ea4d52bd4a9871970ec2bfbf80292ca6e8e8'/>
<id>bdc2ea4d52bd4a9871970ec2bfbf80292ca6e8e8</id>
<content type='text'>
Continuation of 4809c7a to update the use of v8::ExternalArrayType.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Continuation of 4809c7a to update the use of v8::ExternalArrayType.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: update use of ExternalArrayType constants</title>
<updated>2014-10-08T08:06:06+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-10-08T08:06:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=4809c7aa4f84385ba358d1947203fbeba8555b76'/>
<id>4809c7aa4f84385ba358d1947203fbeba8555b76</id>
<content type='text'>
The constants in enum v8::ExternalArrayType have been changed. The old
values are there for legacy reasons, but it's best to update anyway.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The constants in enum v8::ExternalArrayType have been changed. The old
values are there for legacy reasons, but it's best to update anyway.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: rework double free bug fix</title>
<updated>2014-05-23T22:21:35+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2014-05-23T13:27:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=4394c8a9b3889436fa957ea52955936a2640407b'/>
<id>4394c8a9b3889436fa957ea52955936a2640407b</id>
<content type='text'>
Rework the fix from commit 6810132 in a way that removes ~60 lines of
code.

The bug was introduced in commit e87ceb2 (mea culpa) and is at its core
a pointer aliasing bug where sometimes two independent pointers existed
that pointed to the same chunk of heap memory.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rework the fix from commit 6810132 in a way that removes ~60 lines of
code.

The bug was introduced in commit e87ceb2 (mea culpa) and is at its core
a pointer aliasing bug where sometimes two independent pointers existed
that pointed to the same chunk of heap memory.

Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smalloc: prevent double free on dispose()</title>
<updated>2014-05-23T10:42:46+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-05-23T10:42:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=681013223f926378b3e18d43cc7f60b8ab3187b2'/>
<id>681013223f926378b3e18d43cc7f60b8ab3187b2</id>
<content type='text'>
dispose() free's the memory when executed and sets the external array
data to NULL and length to zero.

To prevent the same memory from being free'd twice when the object is
garbage collected we first check if the object's external array data
length == 0. Since alloc() passes NULL to
SetIndexedPropertiesToExternalArrayData() if length == 0 there's no
opportunity for memory leak.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dispose() free's the memory when executed and sets the external array
data to NULL and length to zero.

To prevent the same memory from being free'd twice when the object is
garbage collected we first check if the object's external array data
length == 0. Since alloc() passes NULL to
SetIndexedPropertiesToExternalArrayData() if length == 0 there's no
opportunity for memory leak.
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: truncate buffer after string decode</title>
<updated>2014-04-10T21:20:43+00:00</updated>
<author>
<name>Fedor Indutny</name>
<email>fedor.indutny@gmail.com</email>
</author>
<published>2014-03-27T17:45:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=4c36f3e7e6108660fc3629d76036e40c1938f639'/>
<id>4c36f3e7e6108660fc3629d76036e40c1938f639</id>
<content type='text'>
When our estimates for a storage size are higher than the actual length
of decoded data, the destination buffer should be truncated. Otherwise
`Buffer::Length` will give misleading information to C++ layer.

fix #7365

Signed-off-by: Fedor Indutny &lt;fedor@indutny.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When our estimates for a storage size are higher than the actual length
of decoded data, the destination buffer should be truncated. Otherwise
`Buffer::Length` will give misleading information to C++ layer.

fix #7365

Signed-off-by: Fedor Indutny &lt;fedor@indutny.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: fix up smalloc weak persistent usage</title>
<updated>2014-03-16T12:15:34+00:00</updated>
<author>
<name>Ben Noordhuis</name>
<email>info@bnoordhuis.nl</email>
</author>
<published>2014-03-15T00:12:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=e87ceb2b427a9b51a55af5898c2ef24b4cc08af2'/>
<id>e87ceb2b427a9b51a55af5898c2ef24b4cc08af2</id>
<content type='text'>
Fix a regression that was introduced in commit ce04c726 after the
upgrade to V8 3.24.

The new weak persistent handle API no longer gives you the original
persistent but still requires that you clear it inside your weak
callback.

Rearrange the code in src/smalloc.cc to keep track of the persistent
handle with the least amount of pain and try hard to share as much
code as possible between the 'just free it' and 'invoke my callback'
versions of the smalloc API.

Fixes #7309.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a regression that was introduced in commit ce04c726 after the
upgrade to V8 3.24.

The new weak persistent handle API no longer gives you the original
persistent but still requires that you clear it inside your weak
callback.

Rearrange the code in src/smalloc.cc to keep track of the persistent
handle with the least amount of pain and try hard to share as much
code as possible between the 'just free it' and 'invoke my callback'
versions of the smalloc API.

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