]> git.proxmox.com Git - libgit2.git/commit - src/refs.c
Convert hashtable usage over to khash
authorRussell Belfer <rb@github.com>
Wed, 25 Apr 2012 17:36:01 +0000 (10:36 -0700)
committerRussell Belfer <rb@github.com>
Wed, 25 Apr 2012 18:18:08 +0000 (11:18 -0700)
commit01fed0a8f9b80e80c8f76cde29fc0d66cb77fff7
tree817dbac7a66529c1a25d26cc256b819564b6cb03
parentada488bfe720d0df8187b5b58e326a13b7bdc678
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.
13 files changed:
src/attr.c
src/attr.h
src/attr_file.c
src/config.c
src/config_file.c
src/khash.h
src/khash_oid.h [new file with mode: 0644]
src/khash_str.h [new file with mode: 0644]
src/refs.c
src/refs.h
src/repository.h
src/revwalk.c
src/submodule.c