summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-13 18:21:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-13 18:21:21 (GMT)
commit44e08b003d37440fba6589c07a9573df9d28e6f5 (patch)
treef663e002f1183cf7330b5f34e16b44096ebeb72f /builtin/pack-objects.c
parent57af58e888165db623925f25e290f1b9472fd5c9 (diff)
parent3a0942598ce33b195bfaaf250b2da23e4eceb3c6 (diff)
downloadgit-44e08b003d37440fba6589c07a9573df9d28e6f5.zip
git-44e08b003d37440fba6589c07a9573df9d28e6f5.tar.gz
git-44e08b003d37440fba6589c07a9573df9d28e6f5.tar.bz2
Merge branch 'js/try-to-free-stackable'
* js/try-to-free-stackable: Do not call release_pack_memory in malloc wrappers when GIT_TRACE is used Have set_try_to_free_routine return the previous routine
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 214d7ef..0e81673 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1529,6 +1529,8 @@ static void try_to_free_from_threads(size_t size)
read_unlock();
}
+try_to_free_t old_try_to_free_routine;
+
/*
* The main thread waits on the condition that (at least) one of the workers
* has stopped working (which is indicated in the .working member of
@@ -1563,12 +1565,12 @@ static void init_threaded_search(void)
pthread_mutex_init(&cache_mutex, NULL);
pthread_mutex_init(&progress_mutex, NULL);
pthread_cond_init(&progress_cond, NULL);
- set_try_to_free_routine(try_to_free_from_threads);
+ old_try_to_free_routine = set_try_to_free_routine(try_to_free_from_threads);
}
static void cleanup_threaded_search(void)
{
- set_try_to_free_routine(NULL);
+ set_try_to_free_routine(old_try_to_free_routine);
pthread_cond_destroy(&progress_cond);
pthread_mutex_destroy(&read_mutex);
pthread_mutex_destroy(&cache_mutex);