attr: use hashmap for attribute dictionary

The current implementation of the attribute dictionary uses a custom
hashtable.  This modernizes the dictionary by converting it to the builtin
'hashmap' structure.

Also, in order to enable a threaded API in the future add an
accompanying mutex which must be acquired prior to accessing the
dictionary of interned attributes.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams
2017-01-27 18:02:01 -08:00
committed by Junio C Hamano
parent 428103c7f1
commit 1a600b7555
3 changed files with 134 additions and 46 deletions

View File

@ -1,5 +1,6 @@
#include "cache.h"
#include "exec_cmd.h"
#include "attr.h"
/*
* Many parts of Git have subprograms communicate via pipe, expect the
@ -33,6 +34,8 @@ int main(int argc, const char **argv)
git_setup_gettext();
attr_start();
git_extract_argv0_path(argv[0]);
restore_sigpipe_to_default();