<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ewah, branch v2.40.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-05-20T22:26:59Z</updated>
<entry>
<title>Merge branch 'ep/maint-equals-null-cocci'</title>
<updated>2022-05-20T22:26:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=538dc459a0331c48b893c9f6ca0be5917860bb99'/>
<id>urn:sha1:538dc459a0331c48b893c9f6ca0be5917860bb99</id>
<content type='text'>
Introduce and apply coccinelle rule to discourage an explicit
comparison between a pointer and NULL, and applies the clean-up to
the maintenance track.

* ep/maint-equals-null-cocci:
  tree-wide: apply equals-null.cocci
  tree-wide: apply equals-null.cocci
  contrib/coccinnelle: add equals-null.cocci
</content>
</entry>
<entry>
<title>tree-wide: apply equals-null.cocci</title>
<updated>2022-05-02T16:50:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-02T16:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afe8a9070bc62db9cfde1e30147178c40d391d93'/>
<id>urn:sha1:afe8a9070bc62db9cfde1e30147178c40d391d93</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap-write: remove unused bitmap_reset() function</title>
<updated>2022-04-01T17:16:08Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-31T01:45:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b676b73232fab679502f7c77e60f0852b4f2a09e'/>
<id>urn:sha1:b676b73232fab679502f7c77e60f0852b4f2a09e</id>
<content type='text'>
This function hasn't been used since 449fa5ee069 (pack-bitmap-write:
ignore BITMAP_FLAG_REUSE, 2020-12-08), which was a cleanup commit
intending to get rid of the code around the reusing of bitmaps.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bitmap: implement bitmap_is_subset()</title>
<updated>2020-12-08T22:48:16Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2020-12-08T22:04:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed03a58b655f661ef6f9efd8816efe0c8cf07fa0'/>
<id>urn:sha1:ed03a58b655f661ef6f9efd8816efe0c8cf07fa0</id>
<content type='text'>
The bitmap_is_subset() function checks if the 'self' bitmap contains any
bitmaps that are not on in the 'other' bitmap. Up until this patch, it
had a declaration, but no implementation or callers. A subsequent patch
will want this function, so implement it here.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ewah: add bitmap_dup() function</title>
<updated>2020-12-08T22:48:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-08T22:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ccae08e822d71aaae1aa2660631d7ded8f4b97e7'/>
<id>urn:sha1:ccae08e822d71aaae1aa2660631d7ded8f4b97e7</id>
<content type='text'>
There's no easy way to make a copy of a bitmap. Obviously a caller can
iterate over the bits and set them one by one in a new bitmap, but we
can go much faster by copying whole words with memcpy().

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ewah: implement bitmap_or()</title>
<updated>2020-12-08T22:48:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-08T22:03:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ed675101aad3dcc948ad0e1d41e55d65e693740'/>
<id>urn:sha1:3ed675101aad3dcc948ad0e1d41e55d65e693740</id>
<content type='text'>
We have a function to bitwise-OR an ewah into an uncompressed bitmap,
but not to OR two uncompressed bitmaps. Let's add it.

Interestingly, we have a public header declaration going back to
e1273106f6 (ewah: compressed bitmap implementation, 2013-11-14), but the
function was never implemented. That was all OK since there were no
users of 'bitmap_or()', but a first caller will be added in a couple of
patches.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ewah: make bitmap growth less aggressive</title>
<updated>2020-12-08T22:48:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-08T22:03:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e2d141afdaa2b086ac5d4228de0dd0003eb69ff'/>
<id>urn:sha1:2e2d141afdaa2b086ac5d4228de0dd0003eb69ff</id>
<content type='text'>
If you ask to set a bit in the Nth word and we haven't yet allocated
that many slots in our array, we'll increase the bitmap size to 2*N.
This means we might frequently end up with bitmaps that are twice the
necessary size (as soon as you ask for the biggest bit, we'll size up to
twice that).

But if we just allocate as many words as were asked for, we may not grow
fast enough. The worst case there is setting bit 0, then 1, etc. Each
time we grow we'd just extend by one more word, giving us linear
reallocations (and quadratic memory copies).

A middle ground is relying on alloc_nr(), which causes us to grow by a
factor of roughly 3/2 instead of 2. That's less aggressive than
doubling, and it may help avoid fragmenting memory. (If we start with N,
then grow twice, our total is N*(3/2)^2 = 9N/4. After growing twice,
that array of size 9N/4 can fit into the space vacated by the original
array and first growth, N+3N/2 = 10N/4 &gt; 9N/4, leading to less
fragmentation in memory).

Our worst case is still 3/2N wasted bits (you set bit N-1, then setting
bit N causes us to grow by 3/2), but our average should be much better.

This isn't usually that big a deal, but it will matter as we shift the
reachability bitmap generation code to store more bitmaps in memory.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ewah: factor out bitmap growth</title>
<updated>2020-12-08T22:48:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-08T22:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d574bf43e806e0d4d6cda7c2f5d016a87843078f'/>
<id>urn:sha1:d574bf43e806e0d4d6cda7c2f5d016a87843078f</id>
<content type='text'>
We auto-grow bitmaps when somebody asks to set a bit whose position is
outside of our currently allocated range. Other operations besides
single bit-setting might need to do this, too, so let's pull it into its
own function.

Note that we change the semantics a little: you now ask for the number
of words you'd like to have, not the id of the block you'd like to write
to.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ewah/ewah_bitmap.c: avoid open-coding ALLOC_GROW()</title>
<updated>2020-12-08T22:48:15Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-12-08T22:03:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b1ca60f8f317b483c8c1805ab500ff2b014cbec'/>
<id>urn:sha1:3b1ca60f8f317b483c8c1805ab500ff2b014cbec</id>
<content type='text'>
'ewah/ewah_bitmap.c:buffer_grow()' is responsible for growing the buffer
used to store the bits of an EWAH bitmap. It is essentially doing the
same task as the 'ALLOC_GROW()' macro, so use that instead.

This simplifies the callers of 'buffer_grow()', who no longer have to
ask for a specific size, but rather specify how much of the buffer they
need. They also no longer need to guard 'buffer_grow()' behind an if
statement, since 'ALLOC_GROW()' (and, by extension, 'buffer_grow()') is
a noop if the buffer is already large enough.

But, the most significant change is that this fixes a bug when calling
buffer_grow() with both 'alloc_size' and 'new_size' set to 1. In this
case, truncating integer math will leave the new size set to 1, causing
the buffer to never grow.

Instead, let alloc_nr() handle this, which asks for '(new_size + 16) * 3
/ 2' instead of 'new_size * 3 / 2'.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
