summaryrefslogtreecommitdiff
path: root/src/refs.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-04-25 10:36:01 -0700
committerRussell Belfer <rb@github.com>2012-04-25 11:18:08 -0700
commit01fed0a8f9b80e80c8f76cde29fc0d66cb77fff7 (patch)
tree817dbac7a66529c1a25d26cc256b819564b6cb03 /src/refs.h
parentada488bfe720d0df8187b5b58e326a13b7bdc678 (diff)
downloadlibgit2-01fed0a8f9b80e80c8f76cde29fc0d66cb77fff7.tar.gz
Convert hashtable usage over to khash
This updates khash.h with some extra features (like error checking on allocations, ability to use wrapped malloc, foreach calls, etc), creates two high-level wrappers around khash: `git_khash_str` and `git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables, then converts all of the old usage of `git_hashtable` over to use these new hashtables. For `git_khash_str`, I've tried to create a set of macros that yield an API not too unlike the old `git_hashtable` API. Since the oid hashtable is only used in one file, I haven't bother to set up all those macros and just use the khash APIs directly for now.
Diffstat (limited to 'src/refs.h')
-rw-r--r--src/refs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/refs.h b/src/refs.h
index e4a225ca3..39648e6d9 100644
--- a/src/refs.h
+++ b/src/refs.h
@@ -10,7 +10,7 @@
#include "common.h"
#include "git2/oid.h"
#include "git2/refs.h"
-#include "hashtable.h"
+#include "khash_str.h"
#define GIT_REFS_DIR "refs/"
#define GIT_REFS_HEADS_DIR GIT_REFS_DIR "heads/"
@@ -46,7 +46,7 @@ struct git_reference {
};
typedef struct {
- git_hashtable *packfile;
+ git_khash_str *packfile;
time_t packfile_time;
} git_refcache;