<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/pqueue.c, branch ethomson/winhttp</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/'/>
<entry>
<title>Make sure to always include "common.h" first</title>
<updated>2017-07-03T08:51:48+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-06-30T11:39:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=0c7f49dd4316b332f30b4ea72a657bace41e1245'/>
<id>0c7f49dd4316b332f30b4ea72a657bace41e1245</id>
<content type='text'>
Next to including several files, our "common.h" header also declares
various macros which are then used throughout the project. As such, we
have to make sure to always include this file first in all
implementation files. Otherwise, we might encounter problems or even
silent behavioural differences due to macros or defines not being
defined as they should be. So in fact, our header and implementation
files should make sure to always include "common.h" first.

This commit does so by establishing a common include pattern. Header
files inside of "src" will now always include "common.h" as its first
other file, separated by a newline from all the other includes to make
it stand out as special. There are two cases for the implementation
files. If they do have a matching header file, they will always include
this one first, leading to "common.h" being transitively included as
first file. If they do not have a matching header file, they instead
include "common.h" as first file themselves.

This fixes the outlined problems and will become our standard practice
for header and source files inside of the "src/" from now on.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Next to including several files, our "common.h" header also declares
various macros which are then used throughout the project. As such, we
have to make sure to always include this file first in all
implementation files. Otherwise, we might encounter problems or even
silent behavioural differences due to macros or defines not being
defined as they should be. So in fact, our header and implementation
files should make sure to always include "common.h" first.

This commit does so by establishing a common include pattern. Header
files inside of "src" will now always include "common.h" as its first
other file, separated by a newline from all the other includes to make
it stand out as special. There are two cases for the implementation
files. If they do have a matching header file, they will always include
this one first, leading to "common.h" being transitively included as
first file. If they do not have a matching header file, they instead
include "common.h" as first file themselves.

This fixes the outlined problems and will become our standard practice
for header and source files inside of the "src/" from now on.
</pre>
</div>
</content>
</entry>
<entry>
<title>pqueue: resolve possible NULL pointer dereference</title>
<updated>2016-10-28T14:19:24+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-10-28T14:07:40+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=95fa38802f12b930b3acf3fe842408bb33eb1d18'/>
<id>95fa38802f12b930b3acf3fe842408bb33eb1d18</id>
<content type='text'>
The `git_pqueue` struct allows being fixed in its total number of
entries. In this case, we simply throw away items that are
inserted into the priority queue by examining wether the new item
to be inserted has a higher priority than the previous smallest
one.

This feature somewhat contradicts our pqueue implementation in
that it is allowed to not have a comparison function. In fact, we
also fail to check if the comparison function is actually set in
the case where we add a new item into a fully filled fixed-size
pqueue.

As we cannot determine which item is the smallest item in absence
of a comparison function, we fix the `NULL` pointer dereference
by simply dropping all new items which are about to be inserted
into a full fixed-size pqueue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `git_pqueue` struct allows being fixed in its total number of
entries. In this case, we simply throw away items that are
inserted into the priority queue by examining wether the new item
to be inserted has a higher priority than the previous smallest
one.

This feature somewhat contradicts our pqueue implementation in
that it is allowed to not have a comparison function. In fact, we
also fail to check if the comparison function is actually set in
the case where we add a new item into a fully filled fixed-size
pqueue.

As we cannot determine which item is the smallest item in absence
of a comparison function, we fix the `NULL` pointer dereference
by simply dropping all new items which are about to be inserted
into a full fixed-size pqueue.
</pre>
</div>
</content>
</entry>
<entry>
<title>pqueue: support not having a comparison function</title>
<updated>2016-10-06T09:04:55+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2016-09-23T11:25:35+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=938f8e32ec3fa467454ac44c01b916d17e5731af'/>
<id>938f8e32ec3fa467454ac44c01b916d17e5731af</id>
<content type='text'>
In this case, we simply behave like a vector.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this case, we simply behave like a vector.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix pqueue sort boundary condition bug</title>
<updated>2014-03-12T18:21:55+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2014-03-12T18:21:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=5302a88538c870028f2623b099c66c800f5cfe68'/>
<id>5302a88538c870028f2623b099c66c800f5cfe68</id>
<content type='text'>
If the pqueue comparison fn returned just 0 or 1 (think "a&lt;b")
then the sort order of returned items could be wrong because there
was a "&lt; 0" that really needed to be "&lt;= 0".  Yikes!!!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the pqueue comparison fn returned just 0 or 1 (think "a&lt;b")
then the sort order of returned items could be wrong because there
was a "&lt; 0" that really needed to be "&lt;= 0".  Yikes!!!
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid extra copying in pqueue operations</title>
<updated>2014-02-05T00:46:43+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2014-02-05T00:46:43+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=1bbacc9ff617b67831dbfce5e1b04e1bd8571aa0'/>
<id>1bbacc9ff617b67831dbfce5e1b04e1bd8571aa0</id>
<content type='text'>
This tweaks the pqueue_up and pqueue_down routines so that they
will not do full element swaps but instead carry over the state
of the previous loop iteration and only assign elements for which
we know the final position.  This will avoid a little bit of data
assignment which should improve performance in theory.

Also got rid of some vector helpers that I'm no longer using.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This tweaks the pqueue_up and pqueue_down routines so that they
will not do full element swaps but instead carry over the state
of the previous loop iteration and only assign elements for which
we know the final position.  This will avoid a little bit of data
assignment which should improve performance in theory.

Also got rid of some vector helpers that I'm no longer using.
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert pqueue to just be a git_vector</title>
<updated>2014-02-04T18:01:37+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2014-02-04T18:01:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=882c7742711199f757305687c257ac97262a3a30'/>
<id>882c7742711199f757305687c257ac97262a3a30</id>
<content type='text'>
This updates the git_pqueue to simply be a set of specialized
init/insert/pop functions on a git_vector.

To preserve the pqueue feature of having a fixed size heap, I
converted the "sorted" field in git_vectors to a more general
"flags" field so that pqueue could mix in it's own flag.  This
had a bunch of ramifications because a number of places were
directly looking at the vector "sorted" field - I added a couple
new git_vector helpers (is_sorted, set_sorted) so the specific
representation of this information could be abstracted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This updates the git_pqueue to simply be a set of specialized
init/insert/pop functions on a git_vector.

To preserve the pqueue feature of having a fixed size heap, I
converted the "sorted" field in git_vectors to a more general
"flags" field so that pqueue could mix in it's own flag.  This
had a bunch of ramifications because a number of places were
directly looking at the vector "sorted" field - I added a couple
new git_vector helpers (is_sorted, set_sorted) so the specific
representation of this information could be abstracted.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace pqueue with code from hashsig heap</title>
<updated>2014-02-04T05:02:08+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2014-02-04T05:02:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=4075e060b45a73834a24684ed835d52f7176d58b'/>
<id>4075e060b45a73834a24684ed835d52f7176d58b</id>
<content type='text'>
I accidentally wrote a separate priority queue implementation when
I was working on file rename detection as part of the file hash
signature calculation code.  To simplify licensing terms, I just
adapted that to a general purpose priority queue and replace the
old priority queue implementation that was borrowed from elsewhere.

This also removes parts of the COPYING document that no longer
apply to libgit2.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I accidentally wrote a separate priority queue implementation when
I was working on file rename detection as part of the file hash
signature calculation code.  To simplify licensing terms, I just
adapted that to a general purpose priority queue and replace the
old priority queue implementation that was borrowed from elsewhere.

This also removes parts of the COPYING document that no longer
apply to libgit2.
</pre>
</div>
</content>
</entry>
<entry>
<title>update copyrights</title>
<updated>2013-01-08T23:31:27+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2013-01-08T23:07:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=359fc2d241ac407bdf9bf0d28715705f01ca6360'/>
<id>359fc2d241ac407bdf9bf0d28715705f01ca6360</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Apache license header back to libpqueue files</title>
<updated>2013-01-03T22:16:37+00:00</updated>
<author>
<name>Martin Woodward</name>
<email>martinwo@microsoft.com</email>
</author>
<published>2013-01-03T22:16:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=9a919301c67a88a3dea1c9688d61a1717b333010'/>
<id>9a919301c67a88a3dea1c9688d61a1717b333010</id>
<content type='text'>
The original libpqueue file were licensed under Apache 2.0 so
therefore should retain their copyrights and header as per the
license terms at http://www.apache.org/licenses/LICENSE-2.0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The original libpqueue file were licensed under Apache 2.0 so
therefore should retain their copyrights and header as per the
license terms at http://www.apache.org/licenses/LICENSE-2.0
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix warnings on 64-bit windows builds</title>
<updated>2012-04-17T17:47:39+00:00</updated>
<author>
<name>Russell Belfer</name>
<email>rb@github.com</email>
</author>
<published>2012-04-13T20:00:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=44ef8b1b300f0cd3d8572fa1b40d257462f28240'/>
<id>44ef8b1b300f0cd3d8572fa1b40d257462f28240</id>
<content type='text'>
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
</pre>
</div>
</content>
</entry>
</feed>
