From: Junio C Hamano Date: Thu, 27 Feb 2014 22:01:09 +0000 (-0800) Subject: Merge branch 'kb/fast-hashmap' X-Git-Tag: v2.0.0-rc0~166 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d637d1b9a8fb765a8542e69bd2e04b3e229f663b;p=git Merge branch 'kb/fast-hashmap' Improvements to our hash table to get it to meet the needs of the msysgit fscache project, with some nice performance improvements. * kb/fast-hashmap: name-hash: retire unused index_name_exists() hashmap.h: use 'unsigned int' for hash-codes everywhere test-hashmap.c: drop unnecessary #includes .gitignore: test-hashmap is a generated file read-cache.c: fix memory leaks caused by removed cache entries builtin/update-index.c: cleanup update_one fix 'git update-index --verbose --again' output remove old hash.[ch] implementation name-hash.c: remove cache entries instead of marking them CE_UNHASHED name-hash.c: use new hash map implementation for cache entries name-hash.c: remove unreferenced directory entries name-hash.c: use new hash map implementation for directories diffcore-rename.c: use new hash map implementation diffcore-rename.c: simplify finding exact renames diffcore-rename.c: move code around to prepare for the next patch buitin/describe.c: use new hash map implementation add a hashtable implementation that supports O(1) removal submodule: don't access the .gitmodules cache entry after removing it --- d637d1b9a8fb765a8542e69bd2e04b3e229f663b diff --cc builtin/describe.c index 7db43dae1b,104202898e..dadd999c41 --- a/builtin/describe.c +++ b/builtin/describe.c @@@ -6,10 -6,10 +6,10 @@@ #include "exec_cmd.h" #include "parse-options.h" #include "diff.h" - #include "hash.h" + #include "hashmap.h" #include "argv-array.h" -#define SEEN (1u<<0) +#define SEEN (1u << 0) #define MAX_TAGS (FLAG_BITS - 1) static const char * const describe_usage[] = { @@@ -36,8 -36,9 +36,8 @@@ static const char *diff_index_args[] = "diff-index", "--quiet", "HEAD", "--", NULL }; - struct commit_name { - struct commit_name *next; + struct hashmap_entry entry; unsigned char peeled[20]; struct tag *tag; unsigned prio:2; /* annotated tag = 2, tag = 1, head = 0 */