<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/strmap.h, branch ethomson/proxy</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>map: remove `*map_free` macros</title>
<updated>2017-03-20T08:01:18+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-03-20T08:01:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=94af9155cf908f402e07408d900177280c2e90bb'/>
<id>94af9155cf908f402e07408d900177280c2e90bb</id>
<content type='text'>
The `map_free` functions were not implemented as functions but instead
as macros which also set the map to NULL. While this is most certainly
sensible in most cases, we should prefer the more obvious behavior,
namingly leaving the map pointer intact.

Furthermore, this macro has been refactored incorrectly during the
map-refactorings: the two statements are not actually grouped together
by a `do { ... } while (0)` block, as it is required for macros to
match the behavior of functions more closely. This has led to at least
one subtle nesting error in `pack-objects.c`. The following code block

```
    if (pb-&gt;object_ix)
        git_oidmap_free(pb-&gt;object_ix);
```

would be expanded to

```
    if (pb-&gt;object_ix)
        git_oidmap__free(pb-&gt;object_ix); pb-&gt;object_ix = NULL;
```

which is not what one woudl expect. While it is not a bug here as it
would simply become a no-op, the wrong implementation could lead to bugs
in other occasions.

Fix this by simply removing the macro altogether and replacing it with
real function calls. This leaves the burden of setting the pointer to
NULL afterwards to the caller, but this is actually expected and behaves
like other `free` functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `map_free` functions were not implemented as functions but instead
as macros which also set the map to NULL. While this is most certainly
sensible in most cases, we should prefer the more obvious behavior,
namingly leaving the map pointer intact.

Furthermore, this macro has been refactored incorrectly during the
map-refactorings: the two statements are not actually grouped together
by a `do { ... } while (0)` block, as it is required for macros to
match the behavior of functions more closely. This has led to at least
one subtle nesting error in `pack-objects.c`. The following code block

```
    if (pb-&gt;object_ix)
        git_oidmap_free(pb-&gt;object_ix);
```

would be expanded to

```
    if (pb-&gt;object_ix)
        git_oidmap__free(pb-&gt;object_ix); pb-&gt;object_ix = NULL;
```

which is not what one woudl expect. While it is not a bug here as it
would simply become a no-op, the wrong implementation could lead to bugs
in other occasions.

Fix this by simply removing the macro altogether and replacing it with
real function calls. This leaves the burden of setting the pointer to
NULL afterwards to the caller, but this is actually expected and behaves
like other `free` functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>strmap: remove GIT__USE_STRMAP macro</title>
<updated>2017-02-17T10:41:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-01-27T13:32:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=13c3bc9adf7c3e467c6d1a577859bf31d551022b'/>
<id>13c3bc9adf7c3e467c6d1a577859bf31d551022b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>strmap: convert macros to functions</title>
<updated>2017-02-17T10:41:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-01-27T13:13:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a13cfd2af2aa2f9be660fc1c789405b5188b904d'/>
<id>a13cfd2af2aa2f9be660fc1c789405b5188b904d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>khash: avoid using macro magic to get return address</title>
<updated>2017-02-17T10:41:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-01-27T13:20:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=73028af85c11bd947184a73c1e2d7902819695b2'/>
<id>73028af85c11bd947184a73c1e2d7902819695b2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>khash: avoid using `kh_key`/`kh_val` as lvalue</title>
<updated>2017-02-17T10:41:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-01-27T13:05:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=85d2748c6f75bd810c7376647c8ae32984b5e3bb'/>
<id>85d2748c6f75bd810c7376647c8ae32984b5e3bb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>khash: avoid using `kh_put` directly</title>
<updated>2017-02-17T10:41:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-01-25T14:31:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=f31cb45ad2ca46cc743dfadf5ac8b916cbe4ea9c'/>
<id>f31cb45ad2ca46cc743dfadf5ac8b916cbe4ea9c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>strmap: remove unused macro `git_strmap_insert2`</title>
<updated>2017-02-17T10:41:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-01-25T13:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=bff9b7a5a33c9aa8468d233676aba5dbad37b8d6'/>
<id>bff9b7a5a33c9aa8468d233676aba5dbad37b8d6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove extra semicolon outside of a function</title>
<updated>2015-02-15T20:07:05+00:00</updated>
<author>
<name>Stefan Widgren</name>
<email>stefan.widgren@gmail.com</email>
</author>
<published>2015-02-15T20:07:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=c8e02b8776875e6372fc5eba8fc61c51f14f3392'/>
<id>c8e02b8776875e6372fc5eba8fc61c51f14f3392</id>
<content type='text'>
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update `khash.h` to pull request 42</title>
<updated>2015-02-13T03:54:48+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-02-11T22:51:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=650e45f69124bd8b53ecefddeb214a82538ab2c1'/>
<id>650e45f69124bd8b53ecefddeb214a82538ab2c1</id>
<content type='text'>
https://github.com/attractivechaos/klib/pull/42/files introduces
`kreallocarray`.  Hook that up as our `git__reallocarray`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/attractivechaos/klib/pull/42/files introduces
`kreallocarray`.  Hook that up as our `git__reallocarray`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add diff threading tests and attr file cache locks</title>
<updated>2014-04-17T21:43:45+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2014-02-11T22:45:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=40ed499039f887ebcb0b5badf0157519148398b8'/>
<id>40ed499039f887ebcb0b5badf0157519148398b8</id>
<content type='text'>
This adds a basic test of doing simultaneous diffs on multiple
threads and adds basic locking for the attr file cache because
that was the immediate problem that arose from these tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a basic test of doing simultaneous diffs on multiple
threads and adds basic locking for the attr file cache because
that was the immediate problem that arose from these tests.
</pre>
</div>
</content>
</entry>
</feed>
