summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-09-11 20:06:14 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2015-09-11 20:06:14 -0400
commit220d6f8a104661ae9edc4f96cd8f520ef4c4dc1d (patch)
treeb03f3dbd84b2dcba20b49d6ac872316455a94aa0
parent707f65372b4091ada386f2a04a05e94899e32bfc (diff)
downloadlibgit2-220d6f8a104661ae9edc4f96cd8f520ef4c4dc1d.tar.gz
mempack: expose clear function
-rw-r--r--src/odb_mempack.c5
-rw-r--r--src/oidmap.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index 25f30590c..594a2784c 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -155,17 +155,14 @@ void git_mempack_reset(git_odb_backend *_backend)
git_array_clear(db->commits);
- git_oidmap_free(db->objects);
- db->objects = git_oidmap_alloc();
+ git_oidmap_clear(db->objects);
}
static void impl__free(git_odb_backend *_backend)
{
struct memory_packer_db *db = (struct memory_packer_db *)_backend;
- git_mempack_reset(db);
git_oidmap_free(db->objects);
-
git__free(db);
}
diff --git a/src/oidmap.h b/src/oidmap.h
index d2c451e7f..2cf208f53 100644
--- a/src/oidmap.h
+++ b/src/oidmap.h
@@ -49,4 +49,6 @@ GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
#define git_oidmap_size(h) kh_size(h)
+#define git_oidmap_clear(h) kh_clear(oid, h)
+
#endif