mempack: expose clear function

This commit is contained in:
Edward Thomson 2015-09-11 20:06:14 -04:00
parent 707f65372b
commit 220d6f8a10
2 changed files with 3 additions and 4 deletions

View File

@ -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);
} }

View File

@ -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