<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-bitmap.c, branch v2.6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.6.7</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.6.7'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2016-03-16T17:41:04Z</updated>
<entry>
<title>list-objects: pass full pathname to callbacks</title>
<updated>2016-03-16T17:41:04Z</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://www.git.shady.money/git/commit/?id=2824e1841b99393d2469c495253d547c643bd8f1'/>
<id>urn:sha1:2824e1841b99393d2469c495253d547c643bd8f1</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-03-16T17:41:03Z</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://www.git.shady.money/git/commit/?id=dc06dc880013d48f2b09c6b4295419382f3b8230'/>
<id>urn:sha1:dc06dc880013d48f2b09c6b4295419382f3b8230</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>
<entry>
<title>Merge branch 'es/osx-header-pollutes-mask-macro' into maint</title>
<updated>2015-07-15T18:41:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-07-15T18:41:24Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3f20927717a8541fe607e4227f16ff6e1a5a6e22'/>
<id>urn:sha1:3f20927717a8541fe607e4227f16ff6e1a5a6e22</id>
<content type='text'>
* es/osx-header-pollutes-mask-macro:
  ewah: use less generic macro name
  ewah/bitmap: silence warning about MASK macro redefinition
</content>
</entry>
<entry>
<title>Merge branch 'sb/test-bitmap-free-at-end' into maint</title>
<updated>2015-06-16T21:33:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-16T21:33:47Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=2cd8ebdd3d28359b7886d994e84a8725394935e7'/>
<id>urn:sha1:2cd8ebdd3d28359b7886d994e84a8725394935e7</id>
<content type='text'>
An earlier leakfix to bitmap testing code was incomplete.

* sb/test-bitmap-free-at-end:
  test_bitmap_walk: free bitmap with bitmap_free
</content>
</entry>
<entry>
<title>Merge branch 'rs/plug-leak-in-pack-bitmaps' into maint</title>
<updated>2015-06-05T19:00:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-05T19:00:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=06629901444888e5fa491c5f5f24ff03686af9a9'/>
<id>urn:sha1:06629901444888e5fa491c5f5f24ff03686af9a9</id>
<content type='text'>
The code to read pack-bitmap wanted to allocate a few hundred
pointers to a structure, but by mistake allocated and leaked memory
enough to hold that many actual structures.  Correct the allocation
size and also have it on stack, as it is small enough.

* rs/plug-leak-in-pack-bitmaps:
  pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps
</content>
</entry>
<entry>
<title>ewah: use less generic macro name</title>
<updated>2015-06-03T07:04:01Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-06-03T06:39:37Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=34b935c01f28d34f6764f0e1140ad47e7abdde1b'/>
<id>urn:sha1:34b935c01f28d34f6764f0e1140ad47e7abdde1b</id>
<content type='text'>
The ewah/ewok.h header pollutes the global namespace with
"BITS_IN_WORD", without any specific notion that we are
talking about the bits in an eword_t. We can give this the
more specific name "BITS_IN_EWORD".

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test_bitmap_walk: free bitmap with bitmap_free</title>
<updated>2015-05-22T16:03:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-22T00:53:36Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d201a1ecdb1231a349d696a2252b7209ef7be103'/>
<id>urn:sha1:d201a1ecdb1231a349d696a2252b7209ef7be103</id>
<content type='text'>
Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
noticed that we leak the "result" bitmap. But we should use
"bitmap_free" rather than straight "free", as the former
remembers to free the bitmap array pointed to by the struct.

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>pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps</title>
<updated>2015-05-19T16:31:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2015-05-18T23:24:09Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=599dc766e89fe4f964c197f8d109dfc2e3c890ba'/>
<id>urn:sha1:599dc766e89fe4f964c197f8d109dfc2e3c890ba</id>
<content type='text'>
Use an automatic variable for recent_bitmaps, an array of pointers.
This way we don't allocate too much and don't have to free the memory
at the end.  The old code over-allocated because it reserved enough
memory to store all of the structs it is only pointing to and never
freed it.  160 64-bit pointers take up 1280 bytes, which is not too
much to be placed on the stack.

MAX_XOR_OFFSET is turned into a preprocessor constant to make it
constant enough for use in an non-variable array declaration.

Noticed-by: Stefan Beller &lt;stefanbeller@gmail.com&gt;
Suggested-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/test-bitmap-free-at-end' into maint</title>
<updated>2015-05-13T21:05:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-05-13T21:05:55Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=071e93a14844f474d313eec1a035816192616889'/>
<id>urn:sha1:071e93a14844f474d313eec1a035816192616889</id>
<content type='text'>
* sb/test-bitmap-free-at-end:
  pack-bitmap.c: fix a memleak
</content>
</entry>
<entry>
<title>pack-bitmap.c: fix a memleak</title>
<updated>2015-04-13T04:45:27Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2015-03-31T01:22:10Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f86a3747abc742359397e3050b1fbef297415de5'/>
<id>urn:sha1:f86a3747abc742359397e3050b1fbef297415de5</id>
<content type='text'>
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
