summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cache.c b/src/cache.c
index 263f736fa..c51be895e 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -70,12 +70,6 @@ int git_cache_init(git_cache *cache)
return 0;
}
-void git_cache_free(git_cache *cache)
-{
- git_oidmap_free(cache->map);
- git_mutex_free(&cache->lock);
-}
-
void git_cache_clear(git_cache *cache)
{
git_cached_obj *evict = NULL;
@@ -93,6 +87,14 @@ void git_cache_clear(git_cache *cache)
git_mutex_unlock(&cache->lock);
}
+void git_cache_free(git_cache *cache)
+{
+ git_cache_clear(cache);
+
+ git_oidmap_free(cache->map);
+ git_mutex_free(&cache->lock);
+}
+
/* Call with lock, yo */
static void cache_evict_entries(git_cache *cache, size_t evict_count)
{