<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/tree.c, branch cmn/init-libssh2</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>treebuilder: validate tree entries (optionally)</title>
<updated>2016-02-28T17:38:40+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-02-23T20:00:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=2bbc7d3e564ed262e9555ea4fd081ece5ceb3bff'/>
<id>2bbc7d3e564ed262e9555ea4fd081ece5ceb3bff</id>
<content type='text'>
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to treebuilder insertion.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate
the tree and parent ids given to treebuilder insertion.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: zap warnings around `size_t` vs `uint16_t`</title>
<updated>2016-02-16T11:50:44+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-02-11T22:28:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=aadad4059224c686f1ee1b451e3a29c76b5c4b45'/>
<id>aadad4059224c686f1ee1b451e3a29c76b5c4b45</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: mark a tree as already sorted</title>
<updated>2015-12-06T22:17:19+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-12-06T21:51:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=fc4364696556678f4cac4f6cefed17b94b4ec776'/>
<id>fc4364696556678f4cac4f6cefed17b94b4ec776</id>
<content type='text'>
The trees are sorted on-disk, so we don't have to go over them
again. This cuts almost a fifth of time spent parsing trees.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The trees are sorted on-disk, so we don't have to go over them
again. This cuts almost a fifth of time spent parsing trees.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: use a specialised mode parse function</title>
<updated>2015-12-02T17:59:58+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-12-02T17:56:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=0174f21b0ab1abb24496939d95c0cc84187aba00'/>
<id>0174f21b0ab1abb24496939d95c0cc84187aba00</id>
<content type='text'>
Instead of going out to strtol, which is made to parse generic numbers,
copy a parse function from git which is specialised for file modes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of going out to strtol, which is made to parse generic numbers,
copy a parse function from git which is specialised for file modes.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: mark cloned tree entries as un-pooled</title>
<updated>2015-12-01T13:25:15+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2015-12-01T13:19:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=9487585ddc5d7cbb8b9d085e030a01ff805bc41b'/>
<id>9487585ddc5d7cbb8b9d085e030a01ff805bc41b</id>
<content type='text'>
When duplicating a `struct git_tree_entry` with
`git_tree_entry_dup` the resulting structure is not allocated
inside a memory pool. As we do a 1:1 copy of the original struct,
though, we also copy the `pooled` field, which is set to `true`
for pooled entries. This results in a huge memory leak as we
never free tree entries that were duplicated from a pooled
tree entry.

Fix this by marking the newly duplicated entry as un-pooled.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When duplicating a `struct git_tree_entry` with
`git_tree_entry_dup` the resulting structure is not allocated
inside a memory pool. As we do a 1:1 copy of the original struct,
though, we also copy the `pooled` field, which is set to `true`
for pooled entries. This results in a huge memory leak as we
never free tree entries that were duplicated from a pooled
tree entry.

Fix this by marking the newly duplicated entry as un-pooled.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: ensure the entry filename fits in 16 bits</title>
<updated>2015-11-30T16:32:18+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-11-30T16:32:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=95ae3520c5c9f76a435f63cc2d5e18d7ba0ba171'/>
<id>95ae3520c5c9f76a435f63cc2d5e18d7ba0ba171</id>
<content type='text'>
Return an error in case the length is too big. Also take this
opportunity to have a single allocating function for the size and
overflow logic.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Return an error in case the length is too big. Also take this
opportunity to have a single allocating function for the size and
overflow logic.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: make path len uint16_t and avoid holes</title>
<updated>2015-11-28T18:21:52+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-11-28T18:18:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ee42bb0e3d6534b8ac4d48df90b1bb85323972ea'/>
<id>ee42bb0e3d6534b8ac4d48df90b1bb85323972ea</id>
<content type='text'>
This reduces the size of the struct from 32 to 26 bytes, and leaves a
single padding byte at the end of the struct (which comes from the
zero-length array).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reduces the size of the struct from 32 to 26 bytes, and leaves a
single padding byte at the end of the struct (which comes from the
zero-length array).
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: calculate the filename length once</title>
<updated>2015-11-28T18:21:52+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-11-14T23:44:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=2580077fc2cbb124409bbc6453f2923217ac7957'/>
<id>2580077fc2cbb124409bbc6453f2923217ac7957</id>
<content type='text'>
We already know the size due to the `memchr()` so use that information
instead of calling `strlen()` on it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We already know the size due to the `memchr()` so use that information
instead of calling `strlen()` on it.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: pool the entry memory allocations</title>
<updated>2015-11-28T18:21:51+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-11-14T22:50:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ed970748b600313306657de6e5447e5447790766'/>
<id>ed970748b600313306657de6e5447e5447790766</id>
<content type='text'>
These are rather small allocations, so we end up spending a non-trivial
amount of time asking the OS for memory. Since these entries are tied to
the lifetime of their tree, we can give the tree a pool so we speed up
the allocations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are rather small allocations, so we end up spending a non-trivial
amount of time asking the OS for memory. Since these entries are tied to
the lifetime of their tree, we can give the tree a pool so we speed up
the allocations.
</pre>
</div>
</content>
</entry>
<entry>
<title>tree: avoid advancing over the filename multiple times</title>
<updated>2015-11-28T18:21:51+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-11-14T22:46:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=7132150ddf7a883c1f12a89c2518c1a07c0dc94c'/>
<id>7132150ddf7a883c1f12a89c2518c1a07c0dc94c</id>
<content type='text'>
We've already looked at the filename with `memchr()` and then used
`strlen()` to allocate the entry. We already know how much we have to
advance to get to the object id, so add the filename length instead of
looking at each byte again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've already looked at the filename with `memchr()` and then used
`strlen()` to allocate the entry. We already know how much we have to
advance to get to the object id, so add the filename length instead of
looking at each byte again.
</pre>
</div>
</content>
</entry>
</feed>
