<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-bitmap.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-16T02:05:51Z</updated>
<entry>
<title>pack-bitmap: convert traverse_bitmap_commit_list to object_id</title>
<updated>2017-10-16T02:05:51Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-10-15T22:07:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=206649672e9cae1af7f1e23ea6648b39d73b71a4'/>
<id>urn:sha1:206649672e9cae1af7f1e23ea6648b39d73b71a4</id>
<content type='text'>
Convert traverse_bitmap_commit_list and the callbacks it takes to use a
pointer to struct object_id.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ma/leakplugs'</title>
<updated>2017-09-29T02:23:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-29T02:23:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=69c54c72845ebc686d0f4bdd8d44b06f799b0a80'/>
<id>urn:sha1:69c54c72845ebc686d0f4bdd8d44b06f799b0a80</id>
<content type='text'>
Memory leaks in various codepaths have been plugged.

* ma/leakplugs:
  pack-bitmap[-write]: use `object_array_clear()`, don't leak
  object_array: add and use `object_array_pop()`
  object_array: use `object_array_clear()`, not `free()`
  leak_pending: use `object_array_clear()`, not `free()`
  commit: fix memory leak in `reduce_heads()`
  builtin/commit: fix memory leak in `prepare_index()`
</content>
</entry>
<entry>
<title>pack-bitmap[-write]: use `object_array_clear()`, don't leak</title>
<updated>2017-09-24T01:06:08Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-09-22T23:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d01a7fa65c50e817a935396432e199b7a565f53'/>
<id>urn:sha1:4d01a7fa65c50e817a935396432e199b7a565f53</id>
<content type='text'>
Instead of setting the fields of rev-&gt;pending to 0/NULL, thereby leaking
memory, call `object_array_clear(&amp;rev-&gt;pending)`.

In pack-bitmap.c, we make copies of those fields as `pending_nr` and
`pending_e`. We never update the aliases and the original fields never
change, so the aliases are not really needed and just make it harder
than necessary to understand the code. While we're here, remove the
aliases to make the code easier to follow.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move open_pack_index(), parse_pack_index()</title>
<updated>2017-08-23T22:12:06Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0317f45576a0b48c90c4b023fa572a000633946c'/>
<id>urn:sha1:0317f45576a0b48c90c4b023fa572a000633946c</id>
<content type='text'>
alloc_packed_git() in packfile.c is duplicated from sha1_file.c. In a
subsequent commit, alloc_packed_git() will be removed from sha1_file.c.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/pack-bitmap-unaligned'</title>
<updated>2017-06-30T20:45:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-30T20:45:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca069a3c5ce86303865cf49260ab8f4ff758d1d8'/>
<id>urn:sha1:ca069a3c5ce86303865cf49260ab8f4ff758d1d8</id>
<content type='text'>
An unaligned 32-bit access in pack-bitmap code ahs been corrected.

* jc/pack-bitmap-unaligned:
  pack-bitmap: don't perform unaligned memory access
</content>
</entry>
<entry>
<title>pack-bitmap: don't perform unaligned memory access</title>
<updated>2017-06-26T19:32:31Z</updated>
<author>
<name>James Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2017-06-26T15:16:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da41c942b307e0beab1fc5800a42b0c495f54ff6'/>
<id>urn:sha1:da41c942b307e0beab1fc5800a42b0c495f54ff6</id>
<content type='text'>
The preceding bitmap entries have a 1-byte XOR-offset and 1-byte flags,
so their size is not a multiple of 4. Thus the name-hash cache is only
guaranteed to be 2-byte aligned and so we must use get_be32 rather than
indexing the array directly.

Signed-off-by: James Clarke &lt;jrtc27@jrtc27.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object: convert parse_object* to take struct object_id</title>
<updated>2017-05-08T06:12:58Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-05-06T22:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c251c83df276dc0bff4d008433268ad59b7a8df2'/>
<id>urn:sha1:c251c83df276dc0bff4d008433268ad59b7a8df2</id>
<content type='text'>
Make parse_object, parse_object_or_die, and parse_object_buffer take a
pointer to struct object_id.  Remove the temporary variables inserted
earlier, since they are no longer necessary.  Transform all of the
callers using the following semantic patch:

@@
expression E1;
@@
- parse_object(E1.hash)
+ parse_object(&amp;E1)

@@
expression E1;
@@
- parse_object(E1-&gt;hash)
+ parse_object(E1)

@@
expression E1, E2;
@@
- parse_object_or_die(E1.hash, E2)
+ parse_object_or_die(&amp;E1, E2)

@@
expression E1, E2;
@@
- parse_object_or_die(E1-&gt;hash, E2)
+ parse_object_or_die(E1, E2)

@@
expression E1, E2, E3, E4, E5;
@@
- parse_object_buffer(E1.hash, E2, E3, E4, E5)
+ parse_object_buffer(&amp;E1, E2, E3, E4, E5)

@@
expression E1, E2, E3, E4, E5;
@@
- parse_object_buffer(E1-&gt;hash, E2, E3, E4, E5)
+ parse_object_buffer(E1, E2, E3, E4, E5)

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sha1_file: rename git_open_noatime() to git_open()</title>
<updated>2016-10-25T17:59:13Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2016-10-24T18:02:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5436b57941d99302a4cf68373da6288c11f0340'/>
<id>urn:sha1:a5436b57941d99302a4cf68373da6288c11f0340</id>
<content type='text'>
This function is meant to be used when reading from files in the
object store, and the original objective was to avoid smudging atime
of loose object files too often, hence its name.  Because we'll be
extending its role in the next commit to also arrange the file
descriptors they return auto-closed in the child processes, rename
it to lose "noatime" part that is too specific.

Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>list-objects: pass full pathname to callbacks</title>
<updated>2016-02-12T20:51:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-11T22:28:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de1e67d0703894cb6ea782e36abb63976ab07e60'/>
<id>urn:sha1:de1e67d0703894cb6ea782e36abb63976ab07e60</id>
<content type='text'>
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and we could
simply append "c" to it temporarily, then roll back the
length, without creating a new copy.

So we could improve this by teaching the callsites of
path_name() this trick (and there are only 3). But we can
also notice that no callback actually cares about the
broken-down representation, and simply pass each callback
the full path "a/b/c" as a string. The callback code becomes
even simpler, then, as we do not have to worry about freeing
an allocated buffer, nor rolling back our modification to
the strbuf.

This is theoretically less efficient, as some callbacks
would not bother to format the final path component. But in
practice this is not measurable. Since we use the same
strbuf over and over, our work to grow it is amortized, and
we really only pay to memcpy a few bytes.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>list-objects: drop name_path entirely</title>
<updated>2016-02-12T20:51:15Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-11T22:26:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd64516aca4d4e22acb33c71429d293a14d355cf'/>
<id>urn:sha1:bd64516aca4d4e22acb33c71429d293a14d355cf</id>
<content type='text'>
In the previous commit, we left name_path as a thin wrapper
around a strbuf. This patch drops it entirely. As a result,
every show_object_fn callback needs to be adjusted. However,
none of their code needs to be changed at all, because the
only use was to pass it to path_name(), which now handles
the bare strbuf.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
