Commit 220d6f8a by Edward Thomson

mempack: expose clear function

parent 707f6537
...@@ -155,17 +155,14 @@ void git_mempack_reset(git_odb_backend *_backend) ...@@ -155,17 +155,14 @@ void git_mempack_reset(git_odb_backend *_backend)
git_array_clear(db->commits); git_array_clear(db->commits);
git_oidmap_free(db->objects); git_oidmap_clear(db->objects);
db->objects = git_oidmap_alloc();
} }
static void impl__free(git_odb_backend *_backend) static void impl__free(git_odb_backend *_backend)
{ {
struct memory_packer_db *db = (struct memory_packer_db *)_backend; struct memory_packer_db *db = (struct memory_packer_db *)_backend;
git_mempack_reset(db);
git_oidmap_free(db->objects); git_oidmap_free(db->objects);
git__free(db); git__free(db);
} }
......
...@@ -49,4 +49,6 @@ GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid) ...@@ -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_size(h) kh_size(h)
#define git_oidmap_clear(h) kh_clear(oid, h)
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment