Commit Graph

10 Commits

Author SHA1 Message Date
Vicent Marti
3286c408ec global: Properly use git__ memory wrappers
Ensure that all memory related functions (malloc, calloc, strdup, free,
etc) are using their respective `git__` wrappers.
2011-10-28 19:02:36 -07:00
Vicent Marti
87d9869fc3 Tabify everything
There were quite a few places were spaces were being used instead of
tabs. Try to catch them all. This should hopefully not break anything.
Except for `git blame`. Oh well.
2011-09-19 03:34:49 +03:00
Vicent Marti
bb742ede3d Cleanup legal data
1. The license header is technically not valid if it doesn't have a
copyright signature.

2. The COPYING file has been updated with the different licenses used in
the project.

3. The full GPLv2 header in each file annoys me.
2011-09-19 01:54:32 +03:00
schu
b6817692a6 tsort.c: fix include of common.h
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 12:14:47 +02:00
Vicent Marti
c2db984b1c tsort: Remove unused CLZ methods 2011-07-09 13:27:08 +02:00
nulltoken
ae2e4c6a06 win32: replace usage of _MSV_VER with _MSC_VER 2011-07-09 08:41:02 +02:00
schu
d4cb0ee85c tsort: remove unused but set variable
Signed-off-by: schu <schu-github@schulog.org>
2011-07-07 18:14:53 +02:00
nulltoken
417a581d92 tsort: fix wrong header inclusion 2011-07-07 15:36:58 +02:00
nulltoken
bdcc46111c Fix MSVC compilation warnings 2011-07-07 12:12:34 +02:00
Vicent Marti
de18f27668 vector: Timsort all of the things
Drop the GLibc implementation of Merge Sort and replace it with Timsort.

The algorithm has been tuned to work on arrays of pointers (void **),
so there's no longer a need to abstract the byte-width of each element
in the array.

All the comparison callbacks now take pointers-to-elements, not
pointers-to-pointers, so there's now one less level of dereferencing.

E.g.

	 int index_cmp(const void *a, const void *b)
	 {
	-	const git_index_entry *entry_a = *(const git_index_entry **)(a);
	+	const git_index_entry *entry_a = (const git_index_entry *)(a);

The result is up to a 40% speed-up when sorting vectors. Memory usage
remains lineal.

A new `bsearch` implementation has been added, whose callback also
supplies pointer-to-elements, to uniform the Vector API again.
2011-07-07 02:54:07 +02:00